Bladeren bron

Merge remote-tracking branch 'origin/master'

zouxuan 4 jaren geleden
bovenliggende
commit
ae1f2c9625

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

@@ -6,6 +6,7 @@ import com.ym.mec.common.constant.CommonConstants;
 import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
+import java.util.Comparator;
 import java.util.List;
 
 /**
@@ -80,7 +81,7 @@ public class IndexBaseDto {
                     this.percent = activateNum.divide(total, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN);
                 }
             }else{
-                this.percent = total;
+                this.percent = indexMonthData.stream().max(Comparator.comparing(IndexBaseMonthData::getMonth)).get().getPercent();
             }
         }
     }

+ 0 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Student.java

@@ -44,8 +44,6 @@ public class Student extends SysUser {
 	public Student(Integer userId, String subjectIdList) {
 		this.userId = userId;
 		this.subjectIdList = subjectIdList;
-		this.operatingTag = 1;
-		this.serviceTag = 1;
 	}
 
 	public Boolean getIsNewUser() {

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1258,6 +1258,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 }
             }
             courseScheduleStudentPaymentService.batchInsert(courseScheduleStudentPayments);
+            studentDao.updateStudentServiceTag(studentId,null,YesOrNoEnum.YES.getCode());
         }
 
         return true;

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

@@ -714,6 +714,9 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 			for (CourseScheduleStudentPaymentDto notStartCourse : notStartCourses) {
 				BigDecimal actualPrice = Objects.isNull(notStartCourse.getActualPrice())?BigDecimal.ZERO:notStartCourse.getActualPrice();
 				BigDecimal deductAmount = studentRegistrationService.updateUserSurplusCourseFee(notStartCourse.getUserId(), notStartCourse.getMusicGroupId(), (notStartCourse.getExpectPrice().subtract(actualPrice)).negate(), StringUtils.join("课程结束,扣除课程费用:", notStartCourse.getCourseScheduleId()), null);
+				if(actualPrice.compareTo(actualPrice.add(deductAmount.abs()))==0){
+					continue;
+				}
 				notStartCourse.setActualPrice(actualPrice.add(deductAmount.abs()));
 				needUpdates.add(notStartCourse);
 			}

+ 3 - 2
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -296,12 +296,13 @@
 		WHERE
 			m.del_flag_ = 0
 			AND m.is_lock_ = 0
+		  	AND m.status_ = 'OVER'
 			AND m.organ_id_ IS NOT NULL
 			<if test="groupType!=null">
 				AND m.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
 			<if test="month!=null and month!=''">
-				AND (DATE_FORMAT(m.create_time_, '%Y-%m') &lt;= #{month} OR YEAR(m.create_time_)=3000)
+				AND DATE_FORMAT(m.class_date_, '%Y-%m') &lt;= #{month}
 			</if>
 		GROUP BY
 			m.organ_id_
@@ -336,7 +337,7 @@
 	<select id="getStudentConversionData" resultMap="IndexBaseMonthData">
 		SELECT
 			mg.organ_id_,
-			CONCAT( DATE_FORMAT( NOW(), '%Y-%m' ), '-01' ) month_,
+			CONCAT( #{month}, '-01' ) month_,
 			COUNT( DISTINCT sr.user_id_ ) total_num_,
 			COUNT( DISTINCT IF((cssp.group_type_='PRACTICE' AND pg.type_='CHARGE') OR cssp.group_type_='VIP', cssp.user_id_, NULL) ) activate_num_,
 			TRUNCATE(COUNT( DISTINCT IF((cssp.group_type_='PRACTICE' AND pg.type_='CHARGE') OR cssp.group_type_='VIP', cssp.user_id_, NULL) )/COUNT( DISTINCT sr.user_id_ )*100, 2) percent_