Pārlūkot izejas kodu

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

yonge 4 gadi atpakaļ
vecāks
revīzija
446790e176

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java

@@ -4,6 +4,7 @@ import com.ym.mec.biz.dal.entity.IndexBaseMonthData;
 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;
@@ -79,6 +80,11 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
     List<IndexBaseMonthData> getMusicStudentData(@Param("month") String month,
                                                  @Param("type") String type);
 
+    List<IndexBaseMonthData> getMusicGroupPreRegistrationStudentData(@Param("month") String month);
+
+    List<IndexBaseMonthData> getMusicGroupStudentFromPreData(@Param("month") String month,
+                                                             @Param("paymentStatus") PaymentStatusEnum paymentStatus);
+
     List<IndexBaseMonthData> getStudentConversionData(@Param("month") String month);
 
     List<IndexBaseMonthData> getOtherStudentData(@Param("month") String month);

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

@@ -6,7 +6,9 @@ import com.ym.mec.common.constant.CommonConstants;
 import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.util.Comparator;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -69,7 +71,7 @@ public class IndexBaseDto {
         return indexMonthData;
     }
 
-    public void setIndexMonthData(List<IndexBaseMonthData> indexMonthData) {
+    public void setIndexMonthData(List<IndexBaseMonthData> indexMonthData, Date currentMonth) {
         this.indexMonthData = indexMonthData;
         if(!CollectionUtils.isEmpty(indexMonthData)){
             BigDecimal total = indexMonthData.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add);
@@ -81,7 +83,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 = indexMonthData.stream().max(Comparator.comparing(IndexBaseMonthData::getMonth)).get().getPercent();
+                this.percent = indexMonthData.stream().filter(i->currentMonth.compareTo(i.getMonth())==0).max(Comparator.comparing(IndexBaseMonthData::getMonth)).get().getPercent();
             }
         }
     }

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexDataType.java

@@ -31,6 +31,10 @@ public enum IndexDataType implements BaseEnum<String, IndexDataType> {
     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课"),

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

@@ -25,6 +25,9 @@ public class EmployeeInfoQueryInfo extends QueryInfo {
 	@ApiModelProperty(value = "职位", required = false)
 	private JobTypeEnum position;
 
+	@ApiModelProperty(value = "意向城市", required = false)
+	private String intentionCity;
+
 	@ApiModelProperty(value = "状态", required = false)
 	private StaffStatusEnum status;
 	
@@ -105,4 +108,12 @@ public class EmployeeInfoQueryInfo extends QueryInfo {
 	public void setOperator(String operator) {
 		this.operator = operator;
 	}
+
+	public String getIntentionCity() {
+		return intentionCity;
+	}
+
+	public void setIntentionCity(String intentionCity) {
+		this.intentionCity = intentionCity;
+	}
 }

+ 5 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -50,6 +50,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		List<IndexBaseDto> result = new ArrayList<>();
 
 		DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM");
+		LocalDate nowDate = LocalDate.now();
+		nowDate = nowDate.withDayOfMonth(1);
+		Date currentMonth = Date.from(nowDate.atStartOfDay(DateUtil.zoneId).toInstant());
+
 		LocalDate startDate = LocalDate.now();
 		if(Objects.nonNull(year)){
 			startDate = startDate.withYear(year);
@@ -104,7 +108,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				}
 			}
 			IndexBaseDto indexBaseData = new IndexBaseDto(typeDateMapEntry.getKey(),typeDateMapEntry.getKey().getMsg());
-			indexBaseData.setIndexMonthData(typeDateMapEntry.getValue());
+			indexBaseData.setIndexMonthData(typeDateMapEntry.getValue(), currentMonth);
 			result.add(indexBaseData);
 		}
 

+ 10 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -192,17 +192,17 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 					teacherAttendance.setSignInStatus(YesOrNoEnum.NO);
 				}
 			}else if(date.compareTo(add20Minutes) > 0){
-				if(StringUtils.isEmpty(teacherAttendance.getRemark())&&!teacherSignOutDto.isNotRturnErrorInfo()){
-					//当前为异常签到,请填写原因!
-					result.put("status",2);
-					return result;
-				}
 				//异常签到范围(开始之后  ~  结束之前)
 				teacherAttendance.setSignInStatus(YesOrNoEnum.NO);
 				result.put("signInStatus",1);
 			}else {
 				throw new BizException("签到时间异常");
 			}
+			if(YesOrNoEnum.NO.equals(teacherAttendance.getSignInStatus())&&StringUtils.isEmpty(teacherAttendance.getRemark())&&!teacherSignOutDto.isNotRturnErrorInfo()){
+				//当前为异常签到,请填写原因!
+				result.put("status",2);
+				return result;
+			}
 			teacherAttendance.setSignInDeviceNo(teacherSignOutDto.getTeacherAttendanceInfo().getDeviceNum());
 			if(Objects.nonNull(teacherAttendance.getId())){
 				teacherAttendanceDao.update(teacherAttendance);
@@ -250,16 +250,16 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 				teacherAttendance.setSignOutStatus(YesOrNoEnum.YES);
 				result.put("signOutStatus",0);
 			}else if(date.compareTo(classEndDateAdd60Minutes) > 0 && DateUtil.isSameDay(date, classEndDateTime)){
-				if(StringUtils.isEmpty(teacherAttendance.getSignOutRemark())&&!teacherSignOutDto.isNotRturnErrorInfo()){
-					//当前为异常签退,请填写原因!
-					result.put("status",2);
-					return result;
-				}
 				teacherAttendance.setSignOutStatus(YesOrNoEnum.NO);
 				result.put("signOutStatus",1);
 			}else {
 				throw new BizException("签退时间异常");
 			}
+			if(YesOrNoEnum.NO.equals(teacherAttendance.getSignOutStatus())&&StringUtils.isEmpty(teacherAttendance.getSignOutRemark())&&!teacherSignOutDto.isNotRturnErrorInfo()){
+				//当前为异常签退,请填写原因!
+				result.put("status",2);
+				return result;
+			}
 			teacherAttendance.setSignOutDeviceNo(teacherSignOutDto.getTeacherAttendanceInfo().getDeviceNum());
 			if(Objects.nonNull(teacherAttendance.getId())){
 				teacherAttendanceDao.update(teacherAttendance);

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

@@ -132,6 +132,9 @@
 	        <if test="sourceFrom != null">
 	            AND ei.source_from_ = #{sourceFrom}
 	        </if>
+			<if test="intentionCity != null">
+				AND ei.intention_city_ LIKE CONCAT('%',#{intentionCity},'%')
+			</if>
 	        <if test="position != null">
 	            AND ei.position_ = #{position,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 	        </if>

+ 47 - 0
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -357,4 +357,51 @@
 		ORDER BY
 			mg.organ_id_;
 	</select>
+
+	<select id="getMusicGroupPreRegistrationStudentData" resultMap="IndexBaseMonthData">
+		SELECT
+			mg.organ_id_,
+			CONCAT( #{month}, '-01' ) month_,
+			COUNT( DISTINCT spr.user_id_ ) total_num_,
+			COUNT( DISTINCT spr.user_id_ ) activate_num_,
+			COUNT( DISTINCT spr.user_id_ ) percent_
+		FROM
+			student_pre_registration spr
+			LEFT JOIN music_group mg ON spr.music_group_id_ = mg.id_
+		WHERE
+			mg.del_flag_ = 0
+			AND mg.organ_id_ IS NOT NULL
+			AND DATE_FORMAT( spr.create_time_, '%Y-%m' ) &lt;= #{month}
+		GROUP BY
+			mg.organ_id_
+		ORDER BY
+			mg.organ_id_;
+	</select>
+
+	<select id="getMusicGroupStudentFromPreData" resultMap="IndexBaseMonthData">
+		SELECT
+			mg.organ_id_,
+			CONCAT( #{month}, '-01' ) month_,
+			COUNT( DISTINCT sr.user_id_ ) total_num_,
+			COUNT( DISTINCT sr.user_id_ ) activate_num_,
+			COUNT( DISTINCT sr.user_id_ ) percent_
+		FROM
+			student_registration sr
+			LEFT JOIN student_pre_registration spr ON sr.user_id_ = spr.user_id_
+			AND sr.music_group_id_ = spr.music_group_id_
+			LEFT JOIN music_group mg ON spr.music_group_id_ = mg.id_
+		WHERE
+			mg.del_flag_ = 0
+			AND mg.organ_id_ IS NOT NULL
+			AND mg.status_ = 'PROGRESS'
+			AND sr.music_group_status_ = 'NORMAL'
+		  	<if test="paymentStatus!=null">
+				AND sr.payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+			AND DATE_FORMAT( sr.create_time_, '%Y-%m' ) &lt;= #{month}
+		GROUP BY
+			mg.organ_id_
+		ORDER BY
+			mg.organ_id_;
+	</select>
 </mapper>