Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 4 years ago
parent
commit
fcca360954

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -456,4 +456,14 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
      */
     Set<Integer> queryStudentIdsByClassGroupId(@Param("classGroupId") Integer classGroupId,@Param("musicGroupId") String musicGroupId,
                                                @Param("groupType") GroupType groupType);
+
+    /**
+     * @describe 获取学员班级主教关联记录
+     * @author Joburgess
+     * @date 2021/1/25 0025
+     * @param studentIds:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.BaseMapDto>
+     */
+    List<BaseMapDto<Integer, Integer>> getStudentClassGroupBishopTeacherMap(@Param("studentIds") List<Integer> studentIds,
+                                                                            @Param("musicGroupId") String musicGroupId);
 }

+ 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;
+	}
 }

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -51,6 +51,8 @@ public class StudentServeServiceImpl implements StudentServeService {
     private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;
     @Autowired
     private SysConfigService sysConfigService;
+    @Autowired
+    private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -444,7 +446,7 @@ public class StudentServeServiceImpl implements StudentServeService {
                 Map<Integer, Integer> teacherNumMap = new HashMap<>();
                 for (String groupId : groupCourseInfo.keySet()) {
                     Integer teacherId = null;
-                    List<BaseMapDto<Integer, Integer>> studentTeacherIdList = courseScheduleStudentPaymentDao.getStudentClassGroupBishopTeacherMap(Arrays.asList(studentCourseMapEntry.getKey()), groupId);
+                    List<BaseMapDto<Integer, Integer>> studentTeacherIdList = classGroupStudentMapperDao.getStudentClassGroupBishopTeacherMap(Arrays.asList(studentCourseMapEntry.getKey()), groupId);
                     if(!CollectionUtils.isEmpty(studentTeacherIdList)){
                         teacherId = studentTeacherIdList.get(0).getValue();
                     }
@@ -510,7 +512,7 @@ public class StudentServeServiceImpl implements StudentServeService {
             Map<Integer, Integer> teacherNumMap = new HashMap<>();
             for (String groupId : noCourseStudentMusicIdsMapEntry.getValue()) {
                 Integer teacherId = null;
-                List<BaseMapDto<Integer, Integer>> studentTeacherIdList = courseScheduleStudentPaymentDao.getStudentClassGroupBishopTeacherMap(Arrays.asList(noCourseStudentMusicIdsMapEntry.getKey()), groupId);
+                List<BaseMapDto<Integer, Integer>> studentTeacherIdList = classGroupStudentMapperDao.getStudentClassGroupBishopTeacherMap(Arrays.asList(noCourseStudentMusicIdsMapEntry.getKey()), groupId);
                 if(!CollectionUtils.isEmpty(studentTeacherIdList)){
                     teacherId = studentTeacherIdList.get(0).getValue();
                 }

+ 23 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml

@@ -610,4 +610,27 @@
             </if>
         </where>
     </sql>
+    <select id="getStudentClassGroupBishopTeacherMap" resultType="com.ym.mec.biz.dal.dto.BaseMapDto">
+        SELECT
+        cgsm.user_id_ 'key',
+        cgtm.user_id_ 'value'
+        FROM
+            class_group_student_mapper cgsm
+            LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
+            LEFT JOIN class_group_teacher_mapper cgtm ON cgsm.class_group_id_ = cgtm.class_group_id_
+        WHERE
+        ( cg.del_flag_ IS NULL OR cg.del_flag_ = 0 )
+        AND cg.type_ IN ( 'NORMAL')
+        AND cgtm.teacher_role_ = 'BISHOP'
+        AND cgsm.status_='NORMAL'
+        <if test="musicGroupId!=null and musicGroupId!=''">
+            AND cgsm.music_group_id_ = #{musicGroupId}
+        </if>
+        <if test="studentIds!=null and studentIds.size()>0">
+            AND cgsm.user_id_ IN
+            <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+                #{studentId}
+            </foreach>
+        </if>
+    </select>
 </mapper>

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

@@ -445,7 +445,7 @@
 		LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
 		WHERE
 		cg.type_ IN ('HIGH','HIGH_ONLINE')
-		AND mg.status_ = 'PROGRESS'
+		AND mg.status_ = 'PROGRESS' AND cg.del_flag_ = 0
 		<if test="organIds!=null and organIds.size()>0">
 			AND mg.organ_id_ IN
 			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
@@ -465,7 +465,7 @@
 		LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
 		WHERE
 		cg.type_ IN ('HIGH','HIGH_ONLINE')
-		AND mg.status_ = 'PROGRESS'
+		AND mg.status_ = 'PROGRESS' AND cg.del_flag_ = 0
 		<if test="organIds!=null and organIds.size()>0">
 			AND mg.organ_id_ IN
 			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">

+ 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();