|
@@ -15,6 +15,7 @@ import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.constant.CommonConstants;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
+import com.ym.mec.common.filters.TenantIdThreadLocal;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
@@ -51,7 +52,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
@Autowired
|
|
|
private SysConfigDao sysConfigDao;
|
|
|
@Autowired
|
|
|
- private SysTenantConfigDao sysTenantConfigDao;
|
|
|
+ private SysTenantConfigService sysTenantConfigService;
|
|
|
@Autowired
|
|
|
private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
|
|
|
@Autowired
|
|
@@ -606,6 +607,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
|
|
|
@Override
|
|
|
public Map<String, Object> getIndexErrData(String organIdsStr, IndexErrorType errorType) {
|
|
|
+ Integer tenantId = TenantIdThreadLocal.get();
|
|
|
//只筛选指定时间之后的数据
|
|
|
String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -2)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
|
|
|
|
|
@@ -655,8 +657,14 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
two.setDesc(IndexErrorType.STUDENT_INFO.getMsg());
|
|
|
List<IndexErrInfoDto> twoChild = new ArrayList<>();
|
|
|
//学员请假异常提醒(只提醒本月的异常)
|
|
|
- String format1 = DateUtil.format(new Date(), DateUtil.ISO_YEAR_MONTH_FORMAT);
|
|
|
- twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_ERROR_LEAVE, IndexErrorType.STUDENT_ERROR_LEAVE.getMsg(), indexBaseMonthDataDao.countStudentErrorLeave(organIds,format1,classGroupIds), null));
|
|
|
+ int studentErrorLeave = 0;
|
|
|
+ String studentErrorLeaveNum = sysTenantConfigService.getTenantConfigValue(SysConfigService.STUDENT_ERROR_LEAVE_NUM, tenantId);
|
|
|
+ if(StringUtils.isNotEmpty(studentErrorLeaveNum)){
|
|
|
+ String format1 = DateUtil.format(new Date(), DateUtil.ISO_YEAR_MONTH_FORMAT);
|
|
|
+ studentErrorLeave = indexBaseMonthDataDao.countStudentErrorLeave(organIds, format1, classGroupIds,Integer.parseInt(studentErrorLeaveNum));
|
|
|
+ }
|
|
|
+
|
|
|
+ twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_ERROR_LEAVE, IndexErrorType.STUDENT_ERROR_LEAVE.getMsg(),studentErrorLeave , null));
|
|
|
|
|
|
//未缴费学员数
|
|
|
twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_ARREARAGE, IndexErrorType.STUDENT_ARREARAGE.getMsg(), indexBaseMonthDataDao.countNoPaymentStudentNum(organIds,educationUserId,0), Arrays.asList(educationUserId)));
|
|
@@ -728,7 +736,11 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
if(classGroupIds == null || classGroupIds.size() > 0){
|
|
|
attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime,classGroupIds);
|
|
|
noAttendance = indexBaseMonthDataDao.getNoAttendance(organIds,startTime,classGroupIds);
|
|
|
- courseTimeError = indexBaseMonthDataDao.getCourseTimeError(organIds,classGroupIds);
|
|
|
+ String courseStartTimeError = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_START_TIME_ERROR, tenantId);
|
|
|
+ String courseEndTimeError = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_END_TIME_ERROR, tenantId);
|
|
|
+ if(StringUtils.isNotEmpty(courseStartTimeError) && StringUtils.isNotEmpty(courseEndTimeError)){
|
|
|
+ courseTimeError = indexBaseMonthDataDao.getCourseTimeError(organIds,classGroupIds,courseStartTimeError,courseEndTimeError);
|
|
|
+ }
|
|
|
}
|
|
|
fourChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TIME_ERROR, IndexErrorType.COURSE_TIME_ERROR.getMsg(), courseTimeError, null));
|
|
|
|
|
@@ -1042,7 +1054,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
IndexErrInfoDto indexErrInfoDto = new IndexErrInfoDto();
|
|
|
indexErrInfoDto.setErrorType(WAIT_CREATE_PAYMENT_CALENDER);
|
|
|
indexErrInfoDto.setDesc(WAIT_CREATE_PAYMENT_CALENDER.getMsg());
|
|
|
- String configValue1 = sysTenantConfigDao.getConfigValue(SysConfigService.PUSH_CREATE_PAYMENT_CALENDER, tenantId);
|
|
|
+ String configValue1 = sysTenantConfigService.getTenantConfigValue(SysConfigService.PUSH_CREATE_PAYMENT_CALENDER, tenantId);
|
|
|
if(StringUtils.isNotEmpty(configValue1)){
|
|
|
//获取关联的乐团列表
|
|
|
List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organIds);
|
|
@@ -1095,6 +1107,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
|
|
|
@Override
|
|
|
public Map<String,Boolean> hasIndexErrData(String organIdsStr) {
|
|
|
+ Integer tenantId = TenantIdThreadLocal.get();
|
|
|
String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -2)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
|
|
|
|
|
|
Map<String,Boolean> resultMap = new HashMap<>();
|
|
@@ -1134,9 +1147,13 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
boolean flag2 = false;
|
|
|
if(!flag2){
|
|
|
//学员请假异常提醒(获取前两个月的)
|
|
|
- String format1 = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
|
|
|
- int studentErrorLeaveNum = indexBaseMonthDataDao.countStudentErrorLeave(organIds,format1,classGroupIds);
|
|
|
- if(studentErrorLeaveNum > 0){
|
|
|
+ int studentErrorLeave = 0;
|
|
|
+ String studentErrorLeaveNum = sysTenantConfigService.getTenantConfigValue(SysConfigService.STUDENT_ERROR_LEAVE_NUM, tenantId);
|
|
|
+ if(StringUtils.isNotEmpty(studentErrorLeaveNum)){
|
|
|
+ String format1 = DateUtil.format(new Date(), DateUtil.ISO_YEAR_MONTH_FORMAT);
|
|
|
+ studentErrorLeave = indexBaseMonthDataDao.countStudentErrorLeave(organIds, format1, classGroupIds,Integer.parseInt(studentErrorLeaveNum));
|
|
|
+ }
|
|
|
+ if(studentErrorLeave > 0){
|
|
|
flag2 = true;
|
|
|
}
|
|
|
}
|
|
@@ -1196,7 +1213,11 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
if(!flag4){
|
|
|
int courseTimeError = 0;
|
|
|
if(classGroupIds == null || classGroupIds.size() > 0){
|
|
|
- courseTimeError = indexBaseMonthDataDao.getCourseTimeError(organIds,classGroupIds);
|
|
|
+ String courseStartTimeError = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_START_TIME_ERROR, tenantId);
|
|
|
+ String courseEndTimeError = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_END_TIME_ERROR, tenantId);
|
|
|
+ if(StringUtils.isNotEmpty(courseStartTimeError) && StringUtils.isNotEmpty(courseEndTimeError)){
|
|
|
+ courseTimeError = indexBaseMonthDataDao.getCourseTimeError(organIds,classGroupIds,courseStartTimeError,courseEndTimeError);
|
|
|
+ }
|
|
|
}
|
|
|
if(courseTimeError > 0){
|
|
|
flag4 = true;
|