Browse Source

缴费项目改造

zouxuan 2 years ago
parent
commit
19ea7763cd

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexErrorType.java

@@ -24,6 +24,8 @@ public enum IndexErrorType implements BaseEnum<String, IndexErrorType> {
     ATTENDANCE_ERR_STUDENT_NUM("COURSE_TRUANT_STUDENT_NUM", "学员考勤异常"),
     COURSE_TRUANT_STUDENT_NUM("COURSE_TRUANT_STUDENT_NUM", "学员旷课"),
     COURSE_LEAVE_STUDENT_NUM("COURSE_LEAVE_STUDENT_NUM", "学员请假"),
+    COOPERATION_PAYMENT_ERROR("COOPERATION_PAYMENT_ERROR", "合作单位回款异常"),
+    COOPERATION_PAYMENT_ALERT("COOPERATION_PAYMENT_ALERT", "合作单位回款提醒"),
 
     TEACHER_INFO("TEACHER_INFO", "日常行政"),
 

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

@@ -20,6 +20,17 @@ public class CooperationRefundQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "缴费结束时间",required = false)
     private String refundEndDate;
 
+    @ApiModelProperty(value = "异常类型,COOPERATION_PAYMENT_ERROR 回款异常,COOPERATION_PAYMENT_ALERT 回款提醒",required = false)
+    private String errorType;
+
+    public String getErrorType() {
+        return errorType;
+    }
+
+    public void setErrorType(String errorType) {
+        this.errorType = errorType;
+    }
+
     public Integer getCooperationId() {
         return cooperationId;
     }

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

@@ -63,6 +63,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	private StudentDao studentDao;
 	@Autowired
 	private SysEmployeePositionService employeePositionService;
+	@Autowired
+	private MusicGroupCalenderRefundPeriodDao musicGroupCalenderRefundPeriodDao;
 
 	private static ThreadLocal<Set<Integer>> organIds = new ThreadLocal<Set<Integer>>(){
 		@Override
@@ -732,16 +734,12 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			params.put("tenantId", tenantId);
 			twoChild.add(new IndexErrInfoDto(IndexErrorType.HAS_FREE_COURSE_TIMES, IndexErrorType.HAS_FREE_COURSE_TIMES.getMsg(), musicGroupDao.countHasFreeCourseTimes(params), null));
 
-			//乐团学员会员到期首页提醒
-//			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organIdsStr);
-//			IndexErrInfoDto noClassMusicGroupStudentInfo = new IndexErrInfoDto();
-//			Set<String> musicGroupIds = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
-//			Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
-//			noClassMusicGroupStudentInfo.setErrorType(IndexErrorType.NO_MEMBER_STUDENT_INFO);
-//			noClassMusicGroupStudentInfo.setNum(musicGroupIds.size());
-//			noClassMusicGroupStudentInfo.setNum2(userIds.size());
-//			noClassMusicGroupStudentInfo.setDesc(IndexErrorType.NO_MEMBER_STUDENT_INFO.getMsg());
-//			twoChild.add(noClassMusicGroupStudentInfo);
+			//合作单位回款异常
+			Map<String, Object> params1 = new HashMap<>();
+			params1.put("organId", organIdsStr);
+			params1.put("errorType", "COOPERATION_PAYMENT_ERROR");
+			twoChild.add(new IndexErrInfoDto(IndexErrorType.COOPERATION_PAYMENT_ERROR, IndexErrorType.COOPERATION_PAYMENT_ERROR.getMsg(), musicGroupCalenderRefundPeriodDao.countCoopRefund(params1), null));
+
 			two.setNum(twoChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
 			two.setResult(twoChild);
 			all.add(two);
@@ -1126,6 +1124,13 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		//乐团剩余时长未排课
 		List<String> musicGroupIds = musicGroupDao.queryHasSubCourseTimes(organIds,tenantId);
 		result.add(new IndexErrInfoDto(IndexErrorType.MUSIC_GROUP_HAS_COURSE_TIMES, IndexErrorType.MUSIC_GROUP_HAS_COURSE_TIMES.getMsg(),musicGroupIds.size(), null));
+
+		//合作单位回款提醒
+		Map<String, Object> params = new HashMap<>();
+		params.put("organId", organIds);
+		params.put("errorType", "COOPERATION_PAYMENT_ALERT");
+		result.add(new IndexErrInfoDto(IndexErrorType.COOPERATION_PAYMENT_ERROR, IndexErrorType.COOPERATION_PAYMENT_ERROR.getMsg(), musicGroupCalenderRefundPeriodDao.countCoopRefund(params), null));
+
 		return result;
 	}
 

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

@@ -105,8 +105,16 @@
 	</resultMap>
 	<sql id="queryCoopRefundSql">
 		<where>
+			<if test="errorType != null and errorType != ''">
+				<if test="errorType == 'COOPERATION_PAYMENT_ERROR'">
+					AND TIMESTAMPDIFF(DAY,crp.refund_date_,DATE_FORMAT(NOW(),'%Y-%m-%d')) >= 1
+				</if>
+				<if test="errorType == 'COOPERATION_PAYMENT_ALERT'">
+					AND TIMESTAMPDIFF(DAY,crp.refund_date_,DATE_FORMAT(NOW(),'%Y-%m-%d')) BETWEEN -2 AND 0
+				</if>
+			</if>
 			<if test="organId != null and organId != ''">
-				AND FIND_IN_SET(co.organ_id_,#{organId})
+				AND FIND_IN_SET(crp.organ_id_,#{organId})
 			</if>
 			<if test="search != null and search != ''">
 				AND (co.name_ LIKE CONCAT('%',#{search},'%') OR co.id_ = #{search})