Ver código fonte

Merge branch 'online1' of http://git.dayaedu.com/yonge/mec

 Conflicts:
	mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java
	mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml
	mec-common/audit-log/pom.xml
zouxuan 4 anos atrás
pai
commit
1ab87cdc34

+ 5 - 42
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java

@@ -1,7 +1,10 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.IndexBaseMonthData;
-import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.IndexDataType;
+import com.ym.mec.biz.dal.enums.JobNatureEnum;
+import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.poi.ss.formula.functions.Index;
@@ -21,10 +24,6 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
     int deleteWithMonthAndType(@Param("months") Collection months,
                                @Param("dataType")IndexDataType dataType);
 
-    IndexBaseMonthData getOrganDataWithDayAndDataType(@Param("organId") Integer organId,
-                                                      @Param("day") String day,
-                                                      @Param("dataType")IndexDataType dataType);
-
     /**
      * @describe 获取首页统计数据
      * @author Joburgess
@@ -40,36 +39,6 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                                               @Param("startMonth") String startMonth,
                                               @Param("endMonth") String endMonth);
 
-	List<IndexBaseMonthData> getWithDayAndDataType(@Param("day") String day,
-                                                   @Param("dataType")IndexDataType dataType);
-
-	/**
-	 * @describe 统计学员注册数据
-	 * @author Joburgess
-	 * @date 2021/2/24 0024
-	 * @param dayStr:
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
-	 */
-	List<IndexBaseMonthData> getStudentRegistrationData(@Param("dayStr") String dayStr);
-
-	/**
-	 * @describe 统计新增学员注册数据
-	 * @author Joburgess
-	 * @date 2021/2/24 0024
-	 * @param dayStr:
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
-	 */
-	List<IndexBaseMonthData> getAddStudentRegistrationData(@Param("dayStr") String dayStr);
-
-	/**
-	 * @describe 付费转化率
-	 * @author Joburgess
-	 * @date 2021/2/24 0024
-	 * @param dayStr:
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
-	 */
-	List<IndexBaseMonthData> getChargeStudentChangeData(@Param("dayStr") String dayStr);
-
     /**
      * @describe 统计系统中指定时间段的学员注册数据
      * @author Joburgess
@@ -125,19 +94,13 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
 
     List<IndexBaseMonthData> getOtherStudentData(@Param("dayStr") String dayStr);
 
-    List<IndexBaseMonthData> getVipPracticeAddStudentData(@Param("dayStr") String dayStr);
-
     List<IndexBaseMonthData> getTeacherData(@Param("dayStr") String dayStr,
                                             @Param("jobNature") JobNatureEnum jobNature,
                                             @Param("isDemission") Boolean isDemission);
 
     List<IndexBaseMonthData> getGroupCourseData(@Param("dayStr") String dayStr,
-                                                @Param("groupType")GroupType groupType,
-                                                @Param("courseStatus") CourseStatusEnum courseStatus);
+                                                @Param("groupType")GroupType groupType);
 
-    List<IndexBaseMonthData> getGroupSurplusCourseData(@Param("dayStr") String dayStr,
-                                                @Param("groupType")GroupType groupType,
-                                                @Param("courseStatus") CourseStatusEnum courseStatus);
 
     List<IndexBaseMonthData> getGroupCourseDataWithGroup(@Param("dayStr") String dayStr,
                                                 @Param("groupType")GroupType groupType,

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeGroupDao.java

@@ -106,7 +106,8 @@ public interface PracticeGroupDao extends com.ym.mec.common.dal.BaseDAO<Long, Pr
      * @author Joburgess
      * @date 2020/4/24
      */
-    int checkStudentExitChargePractice(@Param("studentId") Integer studentId);
+    int checkStudentExitChargePractice(@Param("studentId") Integer studentId,
+                                       @Param("startTime") String startTime);
 
     /**
      * @param userId:

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/IndexBaseDto.java

@@ -74,8 +74,8 @@ public class IndexBaseDto {
     public void setIndexMonthData(List<IndexBaseMonthData> indexMonthData, Date currentMonth) {
         this.indexMonthData = indexMonthData;
         if(!CollectionUtils.isEmpty(indexMonthData)){
-            if(dataType.getCollect()){
-                BigDecimal total = indexMonthData.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal total = indexMonthData.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add);
+            if(IndexDataType.ACTIVATION_RATE.equals(dataType)){
                 if(total.compareTo(BigDecimal.ZERO)==0){
                     this.percent = BigDecimal.ZERO;
                 }else{

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderStudentDetail.java

@@ -24,7 +24,7 @@ public class MusicGroupPaymentCalenderStudentDetail {
 	private java.math.BigDecimal courseOriginalPrice;
 	
 	/** 现价 */
-	private java.math.BigDecimal courseCurrentPrice;
+	private java.math.BigDecimal courseCurrentPrice = BigDecimal.ZERO;
 
 	/** 可扣减的课程余额 */
 	private java.math.BigDecimal subCourseAmount;

+ 37 - 75
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexDataType.java

@@ -1,6 +1,5 @@
 package com.ym.mec.biz.dal.enums;
 
-import com.sun.org.apache.xpath.internal.operations.Bool;
 import com.ym.mec.common.enums.BaseEnum;
 
 /**
@@ -8,71 +7,50 @@ import com.ym.mec.common.enums.BaseEnum;
  * @Date 2021/1/8 0008
  **/
 public enum IndexDataType implements BaseEnum<String, IndexDataType> {
-    //学员数据类型
-    STUDENT_REGISTRATION_NUM("STUDENT_REGISTRATION_NUM", "注册学员", false, false),
-    CHARGE_STUDENT_CHANGE_RATE("CHARGE_STUDENT_CHANGE_RATE", "付费转化率", true, false),
-    ACTIVATION_RATE("ACTIVATION_RATE","激活率", true, false),
-
-    //运营数据类型
-    SCHOOL("SCHOOL","合作单位", false, false),
-    PROGRESS_MUSIC_GROUP_NUM("PROGRESS_MUSIC_GROUP_NUM","进行中乐团", false, false),
-
-    //人事数据
-    TEACHER_NUM("TEACHER_NUM","老师总数", false, false),
-    FULL_TIME_NUM("FULL_TIME_NUM","全职人数", false, false),
-    PART_TIME_NUM("PART_TIME_NUM","兼职人数", false, false),
-
-    DIMISSION_NUM("DIMISSION_NUM","离职人数", false, false),
-
-    //剩余课时
-    SURPLUS_COURSE_NUM("SURPLUS_COURSE_NUM", "剩余课时总数", false, false),
-    SURPLUS_MUSIC_COURSE_NUM("SURPLUS_MUSIC_COURSE_NUM", "剩余乐团课时", false, false),
-    SURPLUS_VIP_COURSE_NUM("SURPLUS_VIP_COURSE_NUM", "剩余VIP课时", false, false),
-    SURPLUS_PRACTICE_COURSE_NUM("SURPLUS_PRACTICE_COURSE_NUM", "剩余网管课时", false, false),
-
-    //已消耗课时
-    OVER_COURSE_NUM("OVER_COURSE_NUM", "已消耗课时总数", false, false),
-    OVER_MUSIC_COURSE_NUM("OVER_MUSIC_COURSE_NUM", "已消耗乐团课时", false, false),
-    OVER_VIP_COURSE_NUM("OVER_VIP_COURSE_NUM", "已消耗VIP课时", false, false),
-    OVER_PRACTICE_COURSE_NUM("OVER_PRACTICE_COURSE_NUM", "已消耗网管课时", false, false),
-
-    //经营数据
-    FINANCE_PAY("FINANCE_PAY","财务支出", false, false),
-    FINANCE_BALANCE_AMOUNT("FINANCE_BALANCE_AMOUNT","余额收入", false, false),
-    FINANCE_AMOUNT("FINANCE_AMOUNT","现金收入", false, false),
-
-    //业务数据
-    HOMEWORK_CREATE_RATE("HOMEWORK_CREATE_RATE","作业布置率", true, false),
-    HOMEWORK_SUBMIT_RATE("HOMEWORK_SUBMIT_RATE","作业提交率", true, false),
-    HOMEWORK_COMMENT_RATE("HOMEWORK_COMMENT_RATE","作业点评率", true, false),
-
-    //课程数据
-    MUSIC_GROUP_COURSE("MUSIC_GROUP_COURSE","乐团课", false, false),
-    VIP_GROUP_COURSE("VIP_GROUP_COURSE","VIP课", false, false),
-    PRACTICE_GROUP_COURSE("PRACTICE_GROUP_COURSE","网管课", false, false),
-
-    //学员变动
-    ADD_STUDENT_REGISTRATION_NUM("ADD_STUDENT_REGISTRATION_NUM", "新增注册学员", false, false),
-    MUSIC_GROUP_STUDENT("MUSIC_GROUP_STUDENT","乐团在读学员", false, false),
-    NEWLY_STUDENT_NUM("NEWLY_STUDENT_NUM","乐团新增学员", false, false),
-    QUIT_MUSIC_GROUP_STUDENT_NUM("QUIT_MUSIC_GROUP_STUDENT_NUM","退团学员", false, false),
-    VIP_PRACTICE_STUDENT_NUM("VIP_PRACTICE_STUDENT_NUM", "VIP/网管在读", false, false),
-    VIP_PRACTICE_ADD_STUDENT_NUM("VIP_PRACTICE_ADD_STUDENT_NUM", "VIP/网管新增", false, false),
-    ;
+    SCHOOL("SCHOOL","合作单位"),
+    MUSIC_GROUP_NUM("MUSIC_GROUP_NUM","乐团数量"),
+    MUSIC_GROUP_STUDENT("MUSIC_GROUP_STUDENT","乐团学员"),
+    OTHER_STUDENT("OTHER_STUDENT","其他学员"),
+
+    ACTIVATION_RATE("ACTIVATION_RATE","激活率"),
+    HOMEWORK_CREATE_RATE("HOMEWORK_CREATE_RATE","作业布置率"),
+    HOMEWORK_SUBMIT_RATE("HOMEWORK_SUBMIT_RATE","作业提交率"),
+    HOMEWORK_COMMENT_RATE("HOMEWORK_COMMENT_RATE","作业点评率"),
+
+    SHOULD_INCOME_MONEY("SHOULD_INCOME_MONEY","应收金额"),
+    ANTICIPATED_INCOME_MONEY("ANTICIPATED_INCOME_MONEY","预收金额"),
+    SHOULD_EXPEND_MONEY("SHOULD_EXPEND_MONEY","预付金额"),
+    ANTICIPATED_EXPEND_MONEY("ANTICIPATED_EXPEND_MONEY","应付金额"),
+    REVENUE_MONEY("REVENUE_MONEY","营收金额"),
+
+    TEACHER_NUM("TEACHER_NUM","老师总数"),
+    FULL_TIME_NUM("FULL_TIME_NUM","全职人数"),
+    PART_TIME_NUM("PART_TIME_NUM","兼职人数"),
+    DIMISSION_NUM("DIMISSION_NUM","离职人数"),
+
+    NEWLY_STUDENT_NUM("NEWLY_STUDENT_NUM","乐团新增学员"),
+    QUIT_MUSIC_GROUP_STUDENT_NUM("QUIT_MUSIC_GROUP_STUDENT_NUM","退团学员"),
+    STUDENT_CONVERSION("STUDENT_CONVERSION","学员转化"),
+    STUDENT_CONVERSION_PRE_STUDENT_NUM("STUDENT_CONVERSION_PRE_STUDENT_NUM","预报名人数"),
+    STUDENT_CONVERSION_STUDENT_NUM("STUDENT_CONVERSION_STUDENT_NUM","报名人数"),
+    STUDENT_CONVERSION_PAYMENT_STUDENT_NUM("STUDENT_CONVERSION_PAYMENT_STUDENT_NUM","报名缴费"),
+    STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM("STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM","VIP/网管课购买"),
+
+    MUSIC_GROUP_COURSE("MUSIC_GROUP_COURSE","乐团课"),
+    VIP_GROUP_COURSE("VIP_GROUP_COURSE","VIP课"),
+    PRACTICE_GROUP_COURSE("PRACTICE_GROUP_COURSE","网管课"),
+
+    FINANCE_PAY("FINANCE_PAY","财务支出"),
+    FINANCE_BALANCE_AMOUNT("FINANCE_BALANCE_AMOUNT","余额收入"),
+    FINANCE_AMOUNT("FINANCE_AMOUNT","现金收入");
 
     private String code;
 
     private String msg;
 
-    private Boolean percent;
-
-    private Boolean collect;
-
-    IndexDataType(String code, String msg, Boolean percent, Boolean collect) {
+    IndexDataType(String code, String msg) {
         this.code = code;
         this.msg = msg;
-        this.percent = percent;
-        this.collect = collect;
     }
 
     @Override
@@ -91,20 +69,4 @@ public enum IndexDataType implements BaseEnum<String, IndexDataType> {
     public void setMsg(String msg) {
         this.msg = msg;
     }
-
-    public Boolean getCollect() {
-        return collect;
-    }
-
-    public void setCollect(Boolean collect) {
-        this.collect = collect;
-    }
-
-    public Boolean getPercent() {
-        return percent;
-    }
-
-    public void setPercent(Boolean percent) {
-        this.percent = percent;
-    }
 }

+ 1 - 59
mec-biz/src/main/java/com/ym/mec/biz/event/listener/GroupEventListener.java

@@ -38,65 +38,7 @@ public class GroupEventListener {
     @Async
     @EventListener
     public void musicGroupStudentChangeMonitor(MusicGroupStudentChangeEvent musicGroupStatusChangeEvent){
-        if(Objects.isNull(musicGroupStatusChangeEvent.getMusicGroupId())||Objects.isNull(musicGroupStatusChangeEvent.getStudentMusicGroupStatus())){
-            return;
-        }
-        MusicGroup musicGroup = musicGroupDao.get(musicGroupStatusChangeEvent.getMusicGroupId());
-        if(Objects.isNull(musicGroup)){
-            return;
-        }
-        List<Integer> studentIds = musicGroupStatusChangeEvent.getStudentIds();
-        if(CollectionUtils.isEmpty(studentIds)) {
-            List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryStudentByMusicGroupId(musicGroupStatusChangeEvent.getMusicGroupId());
-            studentIds = studentRegistrations.stream().map(StudentRegistration::getUserId).collect(Collectors.toList());
-        }
-        if(CollectionUtils.isEmpty(studentIds)){
-            return;
-        }
-        List<StudentRegistration> studentNormalRegistration = studentRegistrationDao.getStudentNormalRegistration(new HashSet<>(studentIds));
-        Map<Integer, Set<String>> userGroupIdMap = studentNormalRegistration.stream().collect(Collectors.groupingBy(StudentRegistration::getUserId, Collectors.mapping(StudentRegistration::getMusicGroupId, Collectors.toSet())));
-        int updateNum = 0;
-        for (Integer studentId : studentIds) {
-            if(userGroupIdMap.containsKey(studentId)&&userGroupIdMap.get(studentId).size()>1){
-                continue;
-            }
-            if(userGroupIdMap.containsKey(studentId)&&!userGroupIdMap.get(studentId).contains(musicGroupStatusChangeEvent.getMusicGroupId())){
-                continue;
-            }
-            updateNum+=1;
-        }
-        LocalDate nowDate = LocalDate.now();
-        String dayStr = nowDate.plusDays(-1).toString();
-        IndexBaseMonthData indexBaseMonthData = null;
-        switch (musicGroupStatusChangeEvent.getStudentMusicGroupStatus()){
-            case NORMAL:
-                indexBaseMonthData = indexBaseMonthDataDao.getOrganDataWithDayAndDataType(musicGroup.getOrganId(), dayStr, IndexDataType.NEWLY_STUDENT_NUM);
-                break;
-            case QUIT:
-                indexBaseMonthData = indexBaseMonthDataDao.getOrganDataWithDayAndDataType(musicGroup.getOrganId(), dayStr, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
-                break;
-            default:
-                return;
-        }
-        if(Objects.isNull(indexBaseMonthData)){
-            indexBaseMonthData = new IndexBaseMonthData();
-            Date date = DateUtil.stringToDate(dayStr, "yyyy-MM-dd");
-            BigDecimal zero = new BigDecimal(0);
-            indexBaseMonthData.setMonth(date);
-            indexBaseMonthData.setOrganId(musicGroup.getOrganId());
-            indexBaseMonthData.setDataType(StudentMusicGroupStatusEnum.NORMAL.equals(musicGroupStatusChangeEvent.getStudentMusicGroupStatus())?IndexDataType.NEWLY_STUDENT_NUM:IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
-            indexBaseMonthData.setTotalNum(zero);
-            indexBaseMonthData.setActivateNum(zero);
-            indexBaseMonthData.setPercent(zero);
-        }
-        indexBaseMonthData.setTotalNum(indexBaseMonthData.getTotalNum().add(new BigDecimal(updateNum)));
-        indexBaseMonthData.setActivateNum(indexBaseMonthData.getActivateNum().add(new BigDecimal(updateNum)));
-        indexBaseMonthData.setPercent(indexBaseMonthData.getPercent().add(new BigDecimal(updateNum)));
-        if(Objects.isNull(indexBaseMonthData.getId())){
-            indexBaseMonthDataDao.insert(indexBaseMonthData);
-        }else{
-            indexBaseMonthDataDao.update(indexBaseMonthData);
-        }
+
     }
 
 }

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

@@ -14,7 +14,7 @@ public interface IndexBaseMonthDataService extends BaseService<Long, IndexBaseMo
 
     List<IndexBaseDto> getIndexBaseData(IndexDataQueryInfo indexDataQueryInfo);
 
-    void indexBaseDataTask(String month);
+    Map<String, List<IndexBaseDto>> indexBaseDataTask(String month);
 
     Map<String, Object> getIndexErrData(String organIds, IndexErrorType errorType);
 

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

@@ -192,7 +192,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
 
         Date now=new Date();
 
-        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(practiceGroupBuyParams.getStudentId());
+        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(practiceGroupBuyParams.getStudentId(), "2021-03-10 00:00:00");
 
         LocalDate courseStartDay=LocalDate.now();
         LocalDate tempCourseLocalDate=LocalDate.parse("2020-03-01", DateUtil.dateFormatter);
@@ -286,7 +286,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         }
         BigDecimal oneMonthPrice;
         BigDecimal oneMonthOriginalPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
-        if(practiceBuyActivityExpireDate.after(now)){
+        if(practiceBuyActivityExpireDate.after(now)&&Objects.nonNull(sysUser.getOrganId())&&sysUser.getOrganId()==14&&studentExitChargePractices<=0){
             oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceActivityPrice():practiceGroupSellPrice.getTwiceActivityPrice();
             if(!now.before(practicePromotionActivityStartDate)&&practiceGroupBuyParams.getBuyMonths()>=3&&studentExitChargePractices>0){
                 oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceQuartActivityPrice():practiceGroupSellPrice.getTwiceQuartActivityPrice();
@@ -298,7 +298,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         }
         BigDecimal originalAmount = oneMonthOriginalPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
         BigDecimal amount= oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
-        if(!now.before(practicePromotionActivityStartDate)&&now.before(practiceBuyActivityExpireDate)&&studentExitChargePractices<=0){
+        if(!now.before(practicePromotionActivityStartDate)&&now.before(practiceBuyActivityExpireDate)&&Objects.nonNull(sysUser.getOrganId())&&sysUser.getOrganId()==14&&studentExitChargePractices<=0){
             amount= oneMonthPrice.multiply(new BigDecimal(1));
         }
 

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

@@ -2786,7 +2786,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
         Date now = new Date();
 
-        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(practiceGroupBuyParams.getStudentId());
+        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(practiceGroupBuyParams.getStudentId(),"2021-03-10 00:00:00");
 
         LocalDate courseStartDay = LocalDate.now();
         LocalDate tempCourseLocalDate = LocalDate.parse("2020-03-01", DateUtil.dateFormatter);
@@ -2894,7 +2894,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             throw new BizException("所在城市暂不参与此活动");
         }
         BigDecimal oneMonthPrice;
-        if (practiceBuyActivityExpireDate.after(now)) {
+        if (practiceBuyActivityExpireDate.after(now)&&Objects.nonNull(sysUser.getOrganId())&&sysUser.getOrganId()==14&& studentExitChargePractices <= 0) {
             oneMonthPrice = practiceGroupBuyParams.getDrillTimesOnWeek() == 1 ? practiceGroupSellPrice.getOnceActivityPrice() : practiceGroupSellPrice.getTwiceActivityPrice();
             if (!now.before(practicePromotionActivityStartDate) && practiceGroupBuyParams.getBuyMonths() >= 3 && studentExitChargePractices > 0) {
                 oneMonthPrice = practiceGroupBuyParams.getDrillTimesOnWeek() == 1 ? practiceGroupSellPrice.getOnceQuartActivityPrice() : practiceGroupSellPrice.getTwiceQuartActivityPrice();
@@ -2905,7 +2905,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             oneMonthPrice = practiceGroupBuyParams.getDrillTimesOnWeek() == 1 ? practiceGroupSellPrice.getOnceOriginalPrice() : practiceGroupSellPrice.getTwiceOriginalPrice();
         }
         BigDecimal amount = oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
-        if (!now.before(practicePromotionActivityStartDate) && now.before(practiceBuyActivityExpireDate) && studentExitChargePractices <= 0) {
+        if (!now.before(practicePromotionActivityStartDate) && now.before(practiceBuyActivityExpireDate) && Objects.nonNull(sysUser.getOrganId())&&sysUser.getOrganId()==14 && studentExitChargePractices <= 0) {
             amount = oneMonthPrice.multiply(new BigDecimal(1));
         }
 
@@ -3730,7 +3730,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
     @Override
     public boolean isPurchasedPracticeCourse(Integer userId) {
-        int count = practiceGroupDao.checkStudentExitChargePractice(userId);
+        int count = practiceGroupDao.checkStudentExitChargePractice(userId, null);
         if (count > 0) {
             return true;
         }

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

@@ -672,6 +672,9 @@
 
     <select id="checkStudentExitChargePractice" resultType="int">
         SELECT COUNT(id_) FROM practice_group WHERE type_='CHARGE' AND student_id_=#{studentId} AND group_status_ IN ('NORMAL', 'FINISH')
+        <if test="startTime!=null and startTime!=''">
+            AND create_time_>#{startTime}
+        </if>
     </select>
 
     <select id="countStudentIngTrialPractices" resultType="int">

+ 0 - 2
mec-common/audit-log/src/main/java/com/yonge/log/interceptor/AuditLogInterceptor.java

@@ -15,8 +15,6 @@ import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
 import org.springframework.web.method.HandlerMethod;
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
 

+ 2 - 1
mec-student/src/main/java/com/ym/mec/student/controller/PracticeGroupController.java

@@ -198,8 +198,9 @@ public class PracticeGroupController extends BaseController {
         if (sysUser == null) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
-        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(sysUser.getId());
+        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(sysUser.getId(),"2021-03-10 00:00:00");
         Map<String, Integer> result=new HashMap<>();
+        result.put("organId", sysUser.getOrganId());
         result.put("isNewStudent", studentExitChargePractices<=0?0:1);
         return succeed(result);
     }

+ 3 - 1
mec-web/src/main/java/com/ym/mec/web/controller/education/EduPracticeGroupController.java

@@ -165,8 +165,10 @@ public class EduPracticeGroupController extends BaseController {
         if(Objects.isNull(studentId)){
             throw new BizException("请指定学生");
         }
-        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(studentId);
+        SysUser student = sysUserFeignService.queryUserById(studentId);
+        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(studentId, "2021-03-10 00:00:00");
         Map<String, Integer> result=new HashMap<>();
+        result.put("organId", student.getOrganId());
         result.put("isNewStudent", studentExitChargePractices<=0?0:1);
         return succeed(result);
     }