| 
														
															@@ -5,11 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.baomidou.mybatisplus.core.metadata.IPage; 
														 | 
														
														 | 
														
															 import com.baomidou.mybatisplus.core.metadata.IPage; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.baomidou.mybatisplus.core.toolkit.Wrappers; 
														 | 
														
														 | 
														
															 import com.baomidou.mybatisplus.core.toolkit.Wrappers; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 
														 | 
														
														 | 
														
															 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.yonge.cooleshow.biz.dal.entity.SysArea; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.yonge.cooleshow.biz.dal.entity.SysUser; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.yonge.cooleshow.biz.dal.entity.TenantEntryRecord; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.yonge.cooleshow.biz.dal.entity.TenantInfo; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.yonge.cooleshow.biz.dal.entity.TenantStaff; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.yonge.cooleshow.biz.dal.entity.*; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.yonge.cooleshow.biz.dal.mapper.SysUserMapper; 
														 | 
														
														 | 
														
															 import com.yonge.cooleshow.biz.dal.mapper.SysUserMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.yonge.cooleshow.biz.dal.mapper.TenantApplyRecordMapper; 
														 | 
														
														 | 
														
															 import com.yonge.cooleshow.biz.dal.mapper.TenantApplyRecordMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.yonge.cooleshow.biz.dal.mapper.TenantEntryRecordMapper; 
														 | 
														
														 | 
														
															 import com.yonge.cooleshow.biz.dal.mapper.TenantEntryRecordMapper; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -103,30 +99,19 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //分页查询 
														 | 
														
														 | 
														
															         //分页查询 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<TenantInfoWrapper.TenantInfo> tenantInfos = baseMapper.selectPage(page, query); 
														 | 
														
														 | 
														
															         List<TenantInfoWrapper.TenantInfo> tenantInfos = baseMapper.selectPage(page, query); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //获取id 
														 | 
														
														 | 
														
															         //获取id 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        ArrayList<Integer> listId = new ArrayList<>(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        //查询对应机构的老师学生数量 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        TeacherCounts  teacherCounts= new TeacherCounts(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        StudentCounts  studentCounts= new StudentCounts(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         for (int i = 0; i < tenantInfos.size(); i++) { 
														 | 
														
														 | 
														
															         for (int i = 0; i < tenantInfos.size(); i++) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             TenantInfoWrapper.TenantInfo info = tenantInfos.get(i); 
														 | 
														
														 | 
														
															             TenantInfoWrapper.TenantInfo info = tenantInfos.get(i); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             long id = info.getId(); 
														 | 
														
														 | 
														
															             long id = info.getId(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            listId.add(i,(int)id); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        //查询对应机构的老师数量 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        List<Integer> listTeacher = new ArrayList<>(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        //查询对应机构的学生数量 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        List<Integer> listStudent = new ArrayList<>(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if (!CollectionUtils.isEmpty(listId)) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            listTeacher = tenantInfoMapper.queryTeacherCounts(listId); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            listStudent = tenantInfoMapper.queryStudentCounts(listId); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            teacherCounts = tenantInfoMapper.queryTeacherCounts(id); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            studentCounts = tenantInfoMapper.queryStudentCounts(id); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            info.setTeacherCounts(teacherCounts.getTeacherCounts().toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            info.setStudentCounts(studentCounts.getStudentCounts().toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        for (int j = 0; j < tenantInfos.size(); j++) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            TenantInfoWrapper.TenantInfo tenantInfo = tenantInfos.get(j); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            for (int z = 0; z < listTeacher.size(); z++) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                tenantInfo.setTeacherCounts(listTeacher.get(z).toString()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            for (int t = 0; t < listStudent.size(); t++) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                tenantInfo.setStudentCounts(listStudent.get(t).toString()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -145,17 +130,19 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Override 
														 | 
														
														 | 
														
															     @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public Boolean add(TenantInfo tenantInfo) { 
														 | 
														
														 | 
														
															     public Boolean add(TenantInfo tenantInfo) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SysUser sysUser = getOrCreateAccount(tenantInfo); 
														 | 
														
														 | 
														
															         SysUser sysUser = getOrCreateAccount(tenantInfo); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        tenantInfo.setEnableFlag(true); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        tenantInfo.setUserId(sysUser.getId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        tenantInfoMapper.insert(tenantInfo); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         TenantStaff tenantStaff = new TenantStaff(); 
														 | 
														
														 | 
														
															         TenantStaff tenantStaff = new TenantStaff(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        tenantStaff.setTenantId(tenantStaff.getTenantId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        tenantStaff.setTenantId(tenantInfo.getId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         tenantStaff.setUserId(sysUser.getId()); 
														 | 
														
														 | 
														
															         tenantStaff.setUserId(sysUser.getId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         tenantStaff.setAvatar(sysUser.getAvatar()); 
														 | 
														
														 | 
														
															         tenantStaff.setAvatar(sysUser.getAvatar()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         tenantStaff.setNickname(tenantInfo.getUsername()); 
														 | 
														
														 | 
														
															         tenantStaff.setNickname(tenantInfo.getUsername()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         tenantStaff.setStatus(UserLockFlag.NORMAL); 
														 | 
														
														 | 
														
															         tenantStaff.setStatus(UserLockFlag.NORMAL); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         tenantStaffMapper.insert(tenantStaff); 
														 | 
														
														 | 
														
															         tenantStaffMapper.insert(tenantStaff); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        tenantInfo.setEnableFlag(true); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        tenantInfoMapper.insert(tenantInfo); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return true; 
														 | 
														
														 | 
														
															         return true; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -261,6 +248,8 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             //修改机构账号冻结状态 
														 | 
														
														 | 
														
															             //修改机构账号冻结状态 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             flag = tenantInfoMapper.updateFlag(id); 
														 | 
														
														 | 
														
															             flag = tenantInfoMapper.updateFlag(id); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //修改机构staff状态 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            tenantStaffMapper.updateById(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             //是否更改结算方式 
														 | 
														
														 | 
														
															             //是否更改结算方式 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (query.getIfMethod() == 1) { 
														 | 
														
														 | 
														
															             if (query.getIfMethod() == 1) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 tenantInfoMapper.updateMethod(id); 
														 | 
														
														 | 
														
															                 tenantInfoMapper.updateMethod(id); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -299,6 +288,8 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .set(TenantInfo::getProvinceCode, info.getProvinceCode()) 
														 | 
														
														 | 
														
															                 .set(TenantInfo::getProvinceCode, info.getProvinceCode()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .set(TenantInfo::getCityCode, info.getCityCode()) 
														 | 
														
														 | 
														
															                 .set(TenantInfo::getCityCode, info.getCityCode()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .set(TenantInfo::getRegionCode, info.getRegionCode()) 
														 | 
														
														 | 
														
															                 .set(TenantInfo::getRegionCode, info.getRegionCode()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .set(TenantInfo::getPhone,  info.getPhone()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .set(TenantInfo::getUsername, info.getUsername()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .eq(TenantInfo::getId, info.getId()) 
														 | 
														
														 | 
														
															                 .eq(TenantInfo::getId, info.getId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         ); 
														 | 
														
														 | 
														
															         ); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return true; 
														 | 
														
														 | 
														
															         return true; 
														 |