Browse Source

首页异常提醒修改,乐团学员列表缴费提醒bug修改

zouxuan 4 years ago
parent
commit
4e1f51a793

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

@@ -23,4 +23,10 @@ public interface IndexBaseMonthDataService extends BaseService<Long, IndexBaseMo
      */
     List<IndexErrInfoDto> getRemindMatterData(String organIds);
 
+    /**
+     * 是否有提醒事项
+     * @param organIds
+     * @return
+     */
+    Boolean hasIndexErrData(String organIds);
 }

+ 81 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -416,4 +416,85 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		result.add(indexErrInfoDto);
 		return result;
 	}
+
+	@Override
+	public Boolean hasIndexErrData(String organIdsStr) {
+		Set<Integer> organIds = null;
+		if(StringUtils.isNotBlank(organIdsStr)){
+			organIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
+		}
+		Date date = new Date();
+		int countLessThenThreeClassGroupNum = indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds);
+		if(countLessThenThreeClassGroupNum > 0){
+			return true;
+		}
+		List<Long> errInspection = indexBaseMonthDataDao.queryErrInspection(organIds);
+		if(errInspection.size() > 0){
+			return true;
+		}
+		Date firstDayOfMonth = DateUtil.getFirstDayOfMonth(DateUtil.addMonths(date, -1));
+		int countNoPaymentStudentNum = indexBaseMonthDataDao.countNoPaymentStudentNum(organIds);
+		if(countNoPaymentStudentNum > 0){
+			return true;
+		}
+		List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds);
+		if(quitGroupNum.size() > 0){
+			return true;
+		}
+		List<Long> attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode(),firstDayOfMonth);
+		if(attendanceInfo.size() > 0){
+			return true;
+		}
+		List<Long> attendanceInfo1 = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode(),null);
+		if(attendanceInfo1.size() > 0){
+			return true;
+		}
+		List<Long> attendanceError = indexBaseMonthDataDao.getAttendanceError(organIdsStr,firstDayOfMonth);
+		if(attendanceError.size() > 0){
+			return true;
+		}
+		List<Long> noAttendance = indexBaseMonthDataDao.getNoAttendance(organIdsStr,firstDayOfMonth);
+		if(noAttendance.size() > 0){
+			return true;
+		}
+		List<Long> teacherLeave = indexBaseMonthDataDao.queryTeacherLeave(organIdsStr);
+		if(teacherLeave.size() > 0){
+			return true;
+		}
+		String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
+		List<Long> lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organIdsStr,monthStr);
+		if(lowTeacherSalary.size() > 0){
+			return true;
+		}
+		List<Long> inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr);
+		if(inspectionItem.size() > 0){
+			return true;
+		}
+		List<Long> inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organIdsStr);
+		if(inspectionItemPlan.size() > 0){
+			return true;
+		}
+		List<Long> studentVisit = indexBaseMonthDataDao.queryStudentVisit(organIdsStr);
+		if(studentVisit.size() > 0){
+			return true;
+		}
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			throw new BizException("用户信息获取失败");
+		}
+		//当前用户是否是分部经理
+		List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
+		//获取关联的乐团列表
+		List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(userRole.contains(3)?sysUser.getId():null,organIdsStr);
+		String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
+		date = new Date();
+		String format = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);
+		if(musicGroupIds.size() > 0){
+			List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format,musicGroupIds);
+			if(calenderIds.size() > 0){
+				return true;
+			}
+		}
+		return false;
+	}
 }

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

@@ -387,7 +387,7 @@
 	<select id="queryNoPaymentTotalAmount" resultType="java.util.Map">
 		SELECT mgpcd.user_id_ 'key',SUM(mgpcd.expect_amount_) 'value' FROM music_group_payment_calender_detail mgpcd
 		LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
-		WHERE mgpcd.payment_status_ = 'NON_PAYMENT' AND mgpc.music_group_id_ = #{musicGroupId} AND mgpc.status_ IN ('OPEN','OVER','PAID')
+		WHERE mgpc.batch_no_ IS NULL AND mgpcd.payment_status_ = 'NON_PAYMENT' AND mgpc.music_group_id_ = #{musicGroupId} AND mgpc.status_ IN ('OPEN','OVER','PAID')
 		GROUP BY mgpcd.user_id_
 	</select>
 

+ 24 - 0
mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java

@@ -137,6 +137,30 @@ public class IndexController extends BaseController {
 		return succeed(indexService.getIndexBaseData(dataTypes , organIds, year));
 	}
 
+
+
+	@GetMapping("/hasIndexErrData")
+	public HttpResponseResult hasIndexErrData(String organIds){
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			return failed("用户信息获取失败");
+		}
+		if (!sysUser.getIsSuperAdmin()) {
+			Employee employee = employeeService.get(sysUser.getId());
+			if (StringUtils.isBlank(organIds)) {
+				organIds = employee.getOrganIdList();
+			}else if(StringUtils.isEmpty(employee.getOrganIdList())){
+				return failed("用户所在分部异常");
+			}else {
+				List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+				if(!list.containsAll(Arrays.asList(organIds.split(",")))){
+					return failed("非法请求");
+				}
+			}
+		}
+		return succeed(indexService.hasIndexErrData(organIds));
+	}
+
 	@GetMapping("/getIndexErrData")
 	public HttpResponseResult getIndexErrData(String organIds){
 		SysUser sysUser = sysUserFeignService.queryUserInfo();