yonge 3 年之前
父节点
当前提交
ef7047591d

+ 5 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationServiceImpl.java

@@ -215,8 +215,11 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 
                 tenantContractTemplateDao.update(tenantContractTemplate);
             }
-            //添加签章信息
-            contractService.addTsign(organization.getId(), organization.getCorporateCode(), organization.getCorporateName(), tenantId);
+            
+			if (StringUtils.isNotBlank(organization.getCorporateName()) && StringUtils.isNotBlank(organization.getCorporateCode())) {
+				// 添加签章信息
+				contractService.addTsign(organization.getId(), organization.getCorporateCode(), organization.getCorporateName(), tenantId);
+			}
         }
 		
 		return true;

+ 31 - 25
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -381,16 +381,33 @@ public class StudentServeServiceImpl implements StudentServeService {
             Map<CourseSchedule.CourseScheduleType, List<StudentServeCourseDto>> typeCourseMap = studentCourseMapEntry.getValue().stream().collect(Collectors.groupingBy(StudentServeCourseDto::getType));
             
             Integer userId = studentCourseMapEntry.getKey();
-
+            
+            Set<String> musicGroupIds = noCourseStudentMusicIdsMap.get(studentCourseMapEntry.getKey());
+            if(Objects.isNull(musicGroupIds)){
+                musicGroupIds = new HashSet<>();
+            }
+            //查询用户在指定乐团截止本周末的课程数
+            List<Mapper> mapperList = new ArrayList<Mapper>();
+            if(musicGroupIds.size() > 0){
+            	mapperList = courseScheduleStudentPaymentDao.queryUserMusicGroupCourseNumByClassTime(GroupType.MUSIC, musicGroupIds, userId, new Date(0, 1, 1), LocalDateToUdate(sunDayDate));
+            }
+            Map<Object, Object> map = mapperList.stream().collect(Collectors.toMap(Mapper :: getKey, Mapper :: getValue));
+            
+            //是否在乐团生成服务指标
+            boolean isServiceWithMusicGroup = false;
+            //判断截止本周末是否有乐团课
+            for(Mapper m : mapperList){
+            	if((long)m.getValue() > 0){
+            		isServiceWithMusicGroup = true;
+            	}
+            }
+            
+            if(userId == 2163133){
+            	System.out.println("********************");
+            }
+            
             //有未上的单技课
-            if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.SINGLE)){
-                Set<String> musicGroupIds = noCourseStudentMusicIdsMap.get(studentCourseMapEntry.getKey());
-                if(Objects.isNull(musicGroupIds)){
-                    musicGroupIds = new HashSet<>();
-                }
-                
-                List<Mapper> mapperList = courseScheduleStudentPaymentDao.queryUserMusicGroupCourseNumByClassTime(GroupType.MUSIC, musicGroupIds, userId, new Date(0, 1, 1), LocalDateToUdate(monDayDate));
-                Map<Object, Object> map = mapperList.stream().collect(Collectors.toMap(Mapper :: getKey, Mapper :: getValue));
+            if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.SINGLE) && isServiceWithMusicGroup){
                 
                 List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.SINGLE).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
                 if(!CollectionUtils.isEmpty(weekCourseInfo)){
@@ -398,6 +415,7 @@ public class StudentServeServiceImpl implements StudentServeService {
                     Map<Integer, Set<Long>> teacherNotOverCourseIds = new HashMap<>();
                     Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
                     for (Map.Entry<String, List<StudentServeCourseDto>> groupCourseInfoEntry : groupCourseInfo.entrySet()) {
+                    	
                         if(musicGroupIds.contains(groupCourseInfoEntry.getKey())) {
                             musicGroupIds.remove(groupCourseInfoEntry.getKey());
                         }
@@ -499,14 +517,6 @@ public class StudentServeServiceImpl implements StudentServeService {
                     }
                 }
             }else if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.MIX)){//有未上的合奏课
-                Set<String> musicGroupIds = noCourseStudentMusicIdsMap.get(studentCourseMapEntry.getKey());
-                if(CollectionUtils.isEmpty(musicGroupIds)){
-                    continue;
-                }
-                
-                List<Mapper> mapperList = courseScheduleStudentPaymentDao.queryUserMusicGroupCourseNumByClassTime(GroupType.MUSIC, musicGroupIds, userId, new Date(0, 1, 1), LocalDateToUdate(monDayDate));
-                Map<Object, Object> map = mapperList.stream().collect(Collectors.toMap(Mapper :: getKey, Mapper :: getValue));
-                
                 
                 Map<Integer, Integer> teacherNumMap = new HashMap<>();
                 for (String groupId : musicGroupIds) {
@@ -592,18 +602,14 @@ public class StudentServeServiceImpl implements StudentServeService {
             if(CollectionUtils.isEmpty(musicGroupIds)){
                 continue;
             }
-        	
-            List<Mapper> mapperList = courseScheduleStudentPaymentDao.queryUserMusicGroupCourseNumByClassTime(GroupType.MUSIC, musicGroupIds, noCourseServeStudentId, new Date(0, 1, 1), LocalDateToUdate(monDayDate));
-            Map<Object, Object> map = mapperList.stream().collect(Collectors.toMap(Mapper :: getKey, Mapper :: getValue));
             
+            if(noCourseServeStudentId == 2163133){
+            	System.out.println("********************");
+            }
+        	
             Map<Integer, Integer> teacherNumMap = new HashMap<>();
             for (String groupId : musicGroupIds) {
             	
-                //学生在当前乐团没有上过课,就不需要生成服务指标
-                if(map.get(groupId) == null || (long)map.get(groupId) == 0){
-                	continue;
-                }
-                
                 Integer teacherId = null;
                 List<BaseMapDto<Integer, Integer>> studentTeacherIdList = classGroupStudentMapperDao.getStudentClassGroupBishopTeacherMap(Arrays.asList(noCourseServeStudentId), groupId);
                 if(!CollectionUtils.isEmpty(studentTeacherIdList)){

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

@@ -558,9 +558,9 @@
 			<if test="operatorId!=null">
 				AND EXISTS (SELECT id_ FROM teacher_remind WHERE operator_id_=#{operatorId} AND teacher_id_=sees.teacher_id_ AND monday_ = sees.monday_ AND type_='SERVICE')
 			</if>
-			<!-- <if test="jobNature!=null">
+			<if test="jobNature!=null">
 				AND tea.job_nature_=#{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-			</if> -->
+			</if>
 		</where>
 	</sql>