Browse Source

Merge remote-tracking branch 'origin/saas' into saas

hgw 3 years ago
parent
commit
138a2f113c
31 changed files with 213 additions and 126 deletions
  1. 1 1
      cms/src/main/java/com/ym/mec/cms/controller/NewsController.java
  2. 1 1
      cms/src/main/java/com/ym/mec/cms/interceptor/TenantInterceptor.java
  3. 1 1
      cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml
  4. 11 1
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/TenantInfo.java
  5. 9 0
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/dal/dao/SysRoleDao.java
  6. 13 7
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysRoleServiceImpl.java
  7. 3 0
      mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysRoleMapper.xml
  8. 3 2
      mec-auth/mec-auth-server/src/main/resources/config/mybatis/TenantInfoMapper.xml
  9. 1 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationDao.java
  10. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/PracticeGroupSellPrice.java
  11. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationService.java
  12. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupSellPriceService.java
  13. 4 18
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java
  14. 9 14
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationServiceImpl.java
  15. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupSellPriceServiceImpl.java
  16. 0 8
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  17. 2 2
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  18. 1 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentStudentCourseDetailMapper.xml
  19. 0 1
      mec-biz/src/main/resources/config/mybatis/OrganizationMapper.xml
  20. 4 1
      mec-biz/src/main/resources/config/mybatis/PracticeGroupSellPriceMapper.xml
  21. 1 3
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysEmployeePositionController.java
  22. 0 4
      mec-web/src/main/java/com/ym/mec/web/controller/ActivityPlanController.java
  23. 5 1
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  24. 18 1
      mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java
  25. 0 6
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java
  26. 1 6
      mec-web/src/main/java/com/ym/mec/web/controller/OrganizationController.java
  27. 69 0
      mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupSellPriceController.java
  28. 2 6
      mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java
  29. 1 3
      mec-web/src/main/java/com/ym/mec/web/controller/education/ActivityController.java
  30. 9 21
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduOrganizationController.java
  31. 1 13
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduStudentController.java

+ 1 - 1
cms/src/main/java/com/ym/mec/cms/controller/NewsController.java

@@ -111,7 +111,7 @@ public class NewsController extends BaseController {
 	@GetMapping(value = "/queryPage")
 	public Object queryPage(NewsInformationQueryInfo queryInfo) {
 		
-		if(queryInfo.getType() == 6 || queryInfo.getType() == 7){
+		if(queryInfo.getType() != null && (queryInfo.getType() == 6 || queryInfo.getType() == 7)){
 			queryInfo.setTenantId(-1);
 		}
 		

+ 1 - 1
cms/src/main/java/com/ym/mec/cms/interceptor/TenantInterceptor.java

@@ -29,7 +29,7 @@ public class TenantInterceptor extends HandlerInterceptorAdapter {
 		
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		
-		if(sysUser != null){
+		if(sysUser != null && sysUser.getId() != null){
 			TenantContextHolder.setTenantId(sysUser.getTenantId());
 			
 			TenantInfo tenantInfo = tenantInfoService.get(sysUser.getTenantId());

+ 1 - 1
cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -269,7 +269,7 @@
 				and find_in_set(#{subjectId},sni.subject_id_list_)
 			</if>
 			<if test="organId != null">
-				and (find_in_set(#{organId},sni.organ_id_list_) or sni.organ_id_list_ is null)
+				and (find_in_set(#{organId},sni.organ_id_list_) or sni.organ_id_list_ is null or sni.organ_id_list_ = '')
 			</if>
 		<if test="clientName != 'manage'">
 			<choose>

+ 11 - 1
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/TenantInfo.java

@@ -30,13 +30,23 @@ public class TenantInfo {
 	
 	/** 数据源 */
 	private String dataSource;
+
+	private Integer userId;
 	
 	/**  */
 	private java.util.Date createTime;
 	
 	/**  */
 	private java.util.Date updateTime;
-	
+
+	public Integer getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Integer userId) {
+		this.userId = userId;
+	}
+
 	public void setId(Integer id){
 		this.id = id;
 	}

+ 9 - 0
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/dal/dao/SysRoleDao.java

@@ -28,4 +28,13 @@ public interface SysRoleDao extends BaseDAO<Integer, SysRole> {
      * @return
      */
     SysRole findByRoleName(@Param("roleName") String roleName, @Param("tenantId") Integer tenantId);
+
+    /**
+    * @description: 获取机构管理员角色
+     * @param tenantId
+    * @return java.lang.Integer
+    * @author zx
+    * @date 2022/1/10 14:35
+    */
+    Integer getMinRoleId(@Param("tenantId") Integer tenantId);
 }

+ 13 - 7
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysRoleServiceImpl.java

@@ -7,6 +7,7 @@ import com.ym.mec.auth.service.SysRoleService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.common.tenant.TenantContextHolder;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -40,7 +41,7 @@ public class SysRoleServiceImpl extends BaseServiceImpl<Integer, SysRole>  imple
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void addRole(SysRole sysRole) {
-		SysRole findByName = sysRoleDao.findByRoleName(sysRole.getRoleName(), sysRole.getTenantId());
+		SysRole findByName = sysRoleDao.findByRoleName(sysRole.getRoleName(),sysRole.getTenantId());
 		if(findByName != null){
 			throw new BizException("操作失败:角色 {} 已存在",sysRole.getRoleName());
 		}
@@ -48,10 +49,19 @@ public class SysRoleServiceImpl extends BaseServiceImpl<Integer, SysRole>  imple
 		batchSave(sysRole);
 	}
 
+	public void checkManageRole(Integer id){
+		Integer tenantId = TenantContextHolder.getTenantId();
+		Integer roleId = sysRoleDao.getMinRoleId(tenantId);
+		if(roleId.equals(id)){
+			throw new BizException("操作失败:机构管理员角色不允许调整");
+		}
+	}
+
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void updateRole(SysRole sysRole) {
-		SysRole findByName = sysRoleDao.findByRoleName(sysRole.getRoleName(), sysRole.getTenantId());
+		this.checkManageRole(sysRole.getId());
+		SysRole findByName = sysRoleDao.findByRoleName(sysRole.getRoleName(),sysRole.getTenantId());
 		if(findByName != null && !findByName.getId().equals(sysRole.getId())){
 			throw new BizException("操作失败:角色 {} 已存在",sysRole.getRoleName());
 		}
@@ -64,6 +74,7 @@ public class SysRoleServiceImpl extends BaseServiceImpl<Integer, SysRole>  imple
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void delRole(Integer id) {
+		this.checkManageRole(id);
 		sysRoleDao.delete(id);
 		sysRoleMenuDao.deleteAllMenu(id);
 	}
@@ -78,12 +89,7 @@ public class SysRoleServiceImpl extends BaseServiceImpl<Integer, SysRole>  imple
 	private void batchSave(SysRole sysRole){
 		List<Integer> menuIds = sysRole.getMenuIds();
 		if(menuIds != null && menuIds.size() > 0){
-//			SysRoleMenu sysRoleMenu = new SysRoleMenu(sysRole.getId(),null);
 			sysRoleMenuDao.batchAdd(sysRole.getId(),menuIds, sysRole.getTenantId());
-//			menuIds.forEach(e->{
-//				sysRoleMenu.setMenuId(e);
-//				sysRoleMenuDao.insert(sysRoleMenu);
-//			});
 		}
 	}
 

+ 3 - 0
mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysRoleMapper.xml

@@ -87,4 +87,7 @@
     <select id="findByRoleName" resultMap="SysRole">
         SELECT * FROM sys_role WHERE role_name_ = #{roleName} AND del_flag_ = 0 and tenant_id_ = #{tenantId} LIMIT 1
     </select>
+    <select id="getMinRoleId" resultType="java.lang.Integer">
+        SELECT sr.id_ FROM sys_role WHERE del_flag_ = 0 AND tenant_id_ = #{tenantId} LIMIT 1
+    </select>
 </mapper>

+ 3 - 2
mec-auth/mec-auth-server/src/main/resources/config/mybatis/TenantInfoMapper.xml

@@ -12,6 +12,7 @@
 		<result column="contact_name_" property="contactName" />
 		<result column="contact_phone_" property="contactPhone" />
 		<result column="data_source_" property="dataSource" />
+		<result column="user_id_" property="userId" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
@@ -32,8 +33,8 @@
 	<insert id="insert" parameterType="com.ym.mec.auth.api.entity.TenantInfo"
 		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO tenant_info
-		(id_,name_,address_,domain_name_,logo_url_,contact_name_,contact_phone_,data_source_,create_time_,update_time_)
-		VALUES(#{id},#{name},#{address},#{domainName},#{logoUrl},#{contactName},#{contactPhone},#{dataSource},#{createTime},#{updateTime})
+		(name_,address_,domain_name_,logo_url_,contact_name_,contact_phone_,data_source_,create_time_,update_time_)
+		VALUES(#{name},#{address},#{domainName},#{logoUrl},#{contactName},#{contactPhone},#{dataSource},#{createTime},#{updateTime})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->

+ 1 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationDao.java

@@ -29,10 +29,9 @@ public interface OrganizationDao extends BaseDAO<Integer, Organization> {
 
     /**
      *
-     * @param userId
      * @return
      */
-    List<Organization> queryEmployeeOrgan(@Param("userId") Integer userId, @Param("organId") String organId);
+    List<Organization> queryEmployeeOrgan(@Param("organId") String organId);
 
     /**
      * 根据分部编号获取分部名称map

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/PracticeGroupSellPrice.java

@@ -13,6 +13,8 @@ public class PracticeGroupSellPrice extends BaseEntity {
 
     private Integer organId;
 
+    private String organName;
+
     private BigDecimal onceOriginalPrice;
 
     private BigDecimal onceActivityPrice;
@@ -51,6 +53,14 @@ public class PracticeGroupSellPrice extends BaseEntity {
 
     private Date updateTime;
 
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
     public BigDecimal getSingleClassMinutesPrice() {
         return singleClassMinutesPrice;
     }

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationService.java

@@ -12,10 +12,10 @@ public interface OrganizationService extends BaseService<Integer, Organization>
     Set<Integer>  EXCLUDE_ORGAN_IDS = new HashSet<>(Arrays.asList(36,38,39,41,42,43,44,45,46,47,48,49,50,52,54,55,56,2,27,22,24));
 
     /**
-     * 获取员工在分部列表
+     * 获取员工在分部列表
      * @return
      */
-    List<Organization> queryEmployeeOrgan(Integer userId,String organId) throws Exception;
+    List<Organization> queryEmployeeOrgan() throws Exception;
 
     /**
      * 获取员工坐在分部列表

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupSellPriceService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.PracticeGroupSellPrice;
+import com.ym.mec.common.service.BaseService;
+
+public interface PracticeGroupSellPriceService extends BaseService<Integer, PracticeGroupSellPrice> {
+
+}

+ 4 - 18
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -315,23 +315,8 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		
 		List<MusicGroupPaymentCalenderCourseSettings> courseSettingsList = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(musicGroupPaymentCalenderId);
 
-		//总金额 = 会员费用 + 课程费用
-//		BigDecimal expectAmount = BigDecimal.ZERO;
-//		BigDecimal expectMemberAmount = musicGroupPaymentCalender.getMemberPaymentAmount();
-//		if (musicGroupPaymentCalender.getPayUserType() == STUDENT) {
-//			if (musicGroupPaymentCalender.getPayUserType() == STUDENT) {
-//				for (MusicGroupPaymentCalenderCourseSettings courseSettings : courseSettingsList) {
-//					 剔除可选课程
-//					if (courseSettings.getIsStudentOptional() == false) {
-//						expectAmount = expectAmount.add(courseSettings.getCourseCurrentPrice());
-//					}
-//				}
-//			}
-//		}
-
 		Date date = new Date();
 		MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
-		Map<Integer,MusicGroupPaymentCalenderDetail> userMap = new HashMap<Integer, MusicGroupPaymentCalenderDetail>();
 		List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = new ArrayList<MusicGroupPaymentCalenderDetail>();
 		//创建缴费明细
 		for(Integer studentId : userIdList){
@@ -352,10 +337,11 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
 		}
 
+		Map<Integer,Long> userMap = new HashMap<>();
 		if (musicGroupPaymentCalenderDetailList.size() > 0) {
 			musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
 			for(MusicGroupPaymentCalenderDetail cd : musicGroupPaymentCalenderDetailList){
-				userMap.put(cd.getUserId(), cd);
+				userMap.put(cd.getUserId(), cd.getId());
 			}
 		}
 		//更新预计缴费人数
@@ -379,7 +365,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 					musicGroupPaymentStudentCourseDetail.setCourseType(courseSettings.getCourseType());
 					musicGroupPaymentStudentCourseDetail.setCreateTime(date);
 					musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalenderId);
-					musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderDetailId(userMap.get(studentId).getId());
+					musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderDetailId(userMap.get(studentId));
 					musicGroupPaymentStudentCourseDetail.setTotalCourseMinutes(courseSettings.getCourseTotalMinuties());
 					musicGroupPaymentStudentCourseDetail.setCourseOriginalPrice(courseSettings.getCourseOriginalPrice());
 					musicGroupPaymentStudentCourseDetail.setCourseCurrentPrice(courseSettings.getCourseCurrentPrice());
@@ -545,7 +531,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 
 		if (musicGroupPaymentCalenderDetailList.size() > 0) {
 			musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
-			musicGroupPaymentCalenderDetailList.stream().map(e-> userMap.put(e.getUserId(),e.getId()));
+			musicGroupPaymentCalenderDetailList.stream().forEach(e-> userMap.put(e.getUserId(),e.getId()));
 		}
 		//更新预计缴费人数
 		musicGroupPaymentCalender.setExpectNum(musicGroupPaymentCalender.getExpectNum() + userIdList.size());

+ 9 - 14
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationServiceImpl.java

@@ -55,21 +55,18 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 	}
 
 	@Override
-	public List<Organization> queryEmployeeOrgan(Integer userId,String organId){
-		return organizationDao.queryEmployeeOrgan(userId,organId);
-	}
-
-	@Override
-	public List<Organization> queryEmployeeOrganByUser(){
+	public List<Organization> queryEmployeeOrgan(){
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if(sysUser == null){
 			throw new BizException("获取用户信息失败");
 		}
-		Integer userId = sysUser.getId();
-		if(sysUser.getIsSuperAdmin()){
-			userId = null;
-		}
-		return organizationDao.queryEmployeeOrgan(userId,null);
+		String organIds = this.getEmployeeOrgan(sysUser.getId(), "", sysUser.getIsSuperAdmin());
+		return organizationDao.queryEmployeeOrgan(organIds);
+	}
+
+	@Override
+	public List<Organization> queryEmployeeOrganByUser(){
+		return this.queryEmployeeOrgan();
 	}
 
 	@Override
@@ -219,13 +216,11 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 
     @Override
     public <T extends EducationBaseQueryInfo> T onlyEducation(T queryInfo) {
-		if(StringUtils.isEmpty(queryInfo.getOrganIds())){
-			throw new BizException("请选择分部");
-		}
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {
 			throw new BizException("用户信息获取失败");
 		}
+		queryInfo.setOrganIds(this.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
 		Boolean onlyForRole = employeePositionService.onlyForRole(EDUCATION, sysUser.getId(), sysUser.getIsSuperAdmin());
 		//如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
 		if (onlyForRole) {

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupSellPriceServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.PracticeGroupSellPriceDao;
+import com.ym.mec.biz.dal.entity.PracticeGroupSellPrice;
+import com.ym.mec.biz.service.PracticeGroupSellPriceService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class PracticeGroupSellPriceServiceImpl extends BaseServiceImpl<Integer, PracticeGroupSellPrice> implements PracticeGroupSellPriceService {
+	
+	@Autowired
+	private PracticeGroupSellPriceDao practiceGroupSellPriceDao;
+
+	@Override
+	public BaseDAO<Integer, PracticeGroupSellPrice> getDAO() {
+		return practiceGroupSellPriceDao;
+	}
+
+}

+ 0 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -338,14 +338,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
                 vscps.add(new VipGroupStudentCoursePrice(canBuyStudentId, vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice(), vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice(), vipGroupApplyBaseInfoDto.getTotalPrice()));
             }
         }
-//        Teacher teacher = teacherService.get(vipGroupApplyBaseInfoDto.getUserId());
-//		if(Objects.isNull(teacher)){
-//		    throw new BizException("教师不存在");
-//        }
-//		if(Objects.isNull(teacher.getTeacherOrganId())){
-//		    throw new BizException("教师部门异常");
-//        }
-//        vipGroupApplyBaseInfoDto.setOrganId(Integer.parseInt(teacher.getOrganId()));
         //开课时间为排课的第一节课的开始时间
         vipGroupApplyBaseInfoDto.setCourseStartDate(firstCourseSchedule.getStartClassTime());
         //课程结束时间为排课的最后一节课的结束时间

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

@@ -447,8 +447,8 @@
 			</if>
 			AND mgpcd.payment_status_ = 'NON_PAYMENT' AND mgpc.batch_no_ IS NOT NULL AND mgpc.pay_user_type_ = 'STUDENT'
 			AND (mgpcd.expect_amount_ + mgpcd.expect_member_amount_) > 0
-			<if test="organIds != null and organIds.size() != ''">
-				AND mg.organ_id_ IN FIND_IN_SET(mg.organ_id_,#{organIds})
+			<if test="organIds != null and organIds != ''">
+				AND FIND_IN_SET(mg.organ_id_,#{organIds})
 			</if>
 			<if test="musicGroupId!=null and musicGroupId!=''">
 				AND mgpc.music_group_id_ = #{musicGroupId}

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

@@ -150,7 +150,7 @@
     <delete id="deleteByMusicGroupPaymentCalenderDetailId">
         DELETE FROM music_group_payment_student_course_detail
         <where>
-        	music_group_payment_calender_detail_id_ in    
+        	music_group_payment_calender_detail_id_ IN
 		    <foreach item="item" collection="list" separator="," open="(" close=")" index="">    
 		      #{item}    
 		    </foreach>

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

@@ -139,7 +139,6 @@
         SELECT * FROM organization o
         <where>
             o.del_flag_ = 0
-                AND FIND_IN_SET(o.id_,(SELECT GROUP_CONCAT(organ_id_list_) FROM employee e WHERE e.user_id_ = #{userId}))
             <if test="organId != null and organId != ''">
                 AND FIND_IN_SET(o.id_,#{organId})
             </if>

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

@@ -22,6 +22,7 @@
 		<result column="care_package_price" property="carePackagePrice" />
 		<result column="come_on_package_price" property="comeOnPackagePrice" />
 		<result column="single_class_minutes_price_" property="singleClassMinutesPrice" />
+		<result column="organ_name_" property="organName" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
         <result column="tenant_id_" property="tenantId"/>
@@ -80,7 +81,9 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="PracticeGroupSellPrice" parameterType="map">
-		SELECT * FROM practice_group_sell_price where tenant_id_ = #{tenantId} ORDER BY id_
+		SELECT pgsp.*,o.name_ organ_name_ FROM practice_group_sell_price pgsp
+		LEFT JOIN organization o ON o.id_ = pgsp.organ_id_
+		WHERE pgsp.tenant_id_ = #{tenantId} ORDER BY pgsp.organ_id_
 		<include refid="global.limit" />
 	</select>
 

+ 1 - 3
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysEmployeePositionController.java

@@ -6,7 +6,6 @@ import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -23,8 +22,7 @@ public class SysEmployeePositionController extends BaseController {
 
     @ApiOperation(value = "获取分部下员工职位列表")
     @GetMapping("/findOrganPosition")
-    @PreAuthorize("@pcs.hasPermissions('employeePosition/findOrganPosition')")
-    public Object findAll() throws Exception {
+    public Object findAll(){
         return succeed(employeePositionService.findOrganPosition(organizationService.getTeacherOrgan()));
     }
 }

+ 0 - 4
mec-web/src/main/java/com/ym/mec/web/controller/ActivityPlanController.java

@@ -1,7 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.ActivityPlanAddDto;
 import com.ym.mec.biz.dal.entity.ActivityPlan;
 import com.ym.mec.biz.dal.page.ActivityPlanQueryInfo;
@@ -24,8 +22,6 @@ public class ActivityPlanController extends BaseController {
 
     @Autowired
     private ActivityPlanService activityPlanService;
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
 	@Autowired
 	private OrganizationService organizationService;
 

+ 5 - 1
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -1309,8 +1309,12 @@ public class ExportController extends BaseController {
                 }
                 if (row.getStudentStatus().equals("NORMAL")) {
                     row.setStudentStatus("在读");
-                } else {
+                } else if (row.getStudentStatus().equals("QUIT")) {
                     row.setStudentStatus("退团");
+                } else if (row.getStudentStatus().equals("APPLY")) {
+                    row.setStudentStatus("报名");
+                } else {
+                    row.setStudentStatus("" + row.getStudentStatus());
                 }
                 if (row.getIsActive()) {
                     row.setActiveName("是");

+ 18 - 1
mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java

@@ -11,10 +11,13 @@ import com.ym.mec.biz.service.IndexBaseMonthDataService;
 import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.redisson.api.RBucket;
+import org.redisson.api.RedissonClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.ui.ModelMap;
@@ -25,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 @Api(tags = "首页")
@@ -51,6 +55,8 @@ public class IndexController extends BaseController {
 	private StudentPaymentOrderDao studentPaymentOrderDao;
 	@Autowired
 	private IndexBaseMonthDataService indexService;
+	@Autowired
+	private RedissonClient redissonClient;
 
 	@ApiOperation(value = "获取首页数据")
 	@GetMapping("/index")
@@ -106,7 +112,18 @@ public class IndexController extends BaseController {
 
 	@GetMapping("/hasIndexErrData")
 	public HttpResponseResult hasIndexErrData(String organId){
-		return succeed(indexService.hasIndexErrData(organizationService.getEmployeeOrgan(organId)));
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			throw new BizException("用户信息获取失败");
+		}
+		RBucket<Map<String, Boolean>> bucket = redissonClient.getBucket(sysUser.getId() + ":hasIndexErrData");
+		Map<String, Boolean> map = bucket.get();
+		if(map == null || map.size() == 0){
+			organId = organizationService.getEmployeeOrgan(sysUser.getId(),organId,sysUser.getIsSuperAdmin());
+			map = indexService.hasIndexErrData(organId);
+			bucket.set(map,10, TimeUnit.MINUTES);
+		}
+		return succeed(map);
 	}
 
 	@GetMapping("/getIndexErrData")

+ 0 - 6
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java

@@ -1,7 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAddStudentDto;
 import com.ym.mec.biz.dal.entity.MusicGroup;
@@ -30,10 +28,6 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
 
     @Autowired
     private MusicGroupPaymentCalenderDetailService musicGroupPaymentCalenderDetailService;
-
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
-
     @Autowired
     private OrganizationService organizationService;
 

+ 1 - 6
mec-web/src/main/java/com/ym/mec/web/controller/OrganizationController.java

@@ -48,12 +48,7 @@ public class OrganizationController extends BaseController {
     @GetMapping("/queryEmployeeOrgan")
     @PreAuthorize("@pcs.hasPermissions('organization/queryEmployeeOrgan')")
     public Object queryEmployeeOrgan() throws Exception {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if(sysUser == null){
-			throw new BizException("获取用户信息失败");
-		}
-		Integer userId = sysUser.getId();
-        return succeed(organizationService.queryEmployeeOrgan(userId,null));
+        return succeed(organizationService.queryEmployeeOrgan());
     }
 
     @ApiOperation(value = "获取员工所在分部列表(管理员查看所有的分部)")

+ 69 - 0
mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupSellPriceController.java

@@ -0,0 +1,69 @@
+package com.ym.mec.web.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.biz.dal.entity.PracticeGroupSellPrice;
+import com.ym.mec.biz.service.PracticeGroupSellPriceService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+
+@RequestMapping("practiceGroupSellPrice")
+@Api(tags = "网管课价格配置")
+@RestController
+public class PracticeGroupSellPriceController extends BaseController {
+
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+	@Autowired
+	private PracticeGroupSellPriceService practiceGroupSellPriceService;
+
+	@ApiOperation("分页查询")
+	@GetMapping(value = "/list")
+	@PreAuthorize("@pcs.hasPermissions('practiceGroupSellPrice/list')")
+	public Object getList(QueryInfo queryInfo) {
+		return succeed(practiceGroupSellPriceService.queryPage(queryInfo));
+	}
+
+	@ApiOperation("单查询")
+	@ApiImplicitParam(name = "organId", value = "分部编号", required = true, dataType = "Integer", paramType = "path")
+	@GetMapping(value = "/query")
+	@PreAuthorize("@pcs.hasPermissions('practiceGroupSellPrice/query')")
+	public Object query(Integer organId) {
+		return succeed(practiceGroupSellPriceService.get(organId));
+	}
+
+	@ApiOperation("新增")
+	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PreAuthorize("@pcs.hasPermissions('practiceGroupSellPrice/add')")
+	public Object add(PracticeGroupSellPrice practiceGroupSellPrice) {
+
+		Date date = new Date();
+		practiceGroupSellPrice.setCreateTime(date);
+		practiceGroupSellPrice.setUpdateTime(date);
+		practiceGroupSellPriceService.insert(practiceGroupSellPrice);
+		return succeed();
+	}
+
+	@ApiOperation("更新")
+	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PreAuthorize("@pcs.hasPermissions('practiceGroupSellPrice/update')")
+	public Object update(PracticeGroupSellPrice practiceGroupSellPrice) {
+		practiceGroupSellPrice.setUpdateTime(new Date());
+		practiceGroupSellPriceService.update(practiceGroupSellPrice);
+		return succeed();
+	}
+}

+ 2 - 6
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -373,15 +373,11 @@ public class StudentManageController extends BaseController {
     @GetMapping("/getCloudStudyStudentOverView")
     @PreAuthorize("@pcs.hasPermissions('studentManage/getCloudStudyStudentOverView')")
     public HttpResponseResult<CloudStudyStudentDataDto> getCloudStudyStudentOverView(String organIds) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        List<Integer> organIdsList = new ArrayList<>();
+        List<Integer> organIdsList;
         if(StringUtils.isNotBlank(organIds)){
             organIdsList = Arrays.stream(organIds.split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
         }else{
-            List<Organization> organizations = organizationService.queryEmployeeOrgan(sysUser.getId(),null);
+            List<Organization> organizations = organizationService.queryEmployeeOrgan();
             if(CollectionUtils.isEmpty(organizations)){
                 return succeed();
             }

+ 1 - 3
mec-web/src/main/java/com/ym/mec/web/controller/education/ActivityController.java

@@ -13,10 +13,8 @@ import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.date.DateUtil;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
@@ -244,7 +242,7 @@ public class ActivityController extends BaseController {
     @ApiOperation(value = "云教练活动统计")
     @GetMapping("/countCloudTeacherActive")
     public Object countCloudTeacherActive(CloudTeacherActiveQueryInfo queryInfo) throws Exception {
-        List<Organization> organizations = organizationService.queryEmployeeOrgan(null,null);
+        List<Organization> organizations = organizationService.queryEmployeeOrgan();
         List<Integer> organIds = new ArrayList<>();
         if(StringUtils.isNotBlank(queryInfo.getOrganIds())){
             organIds = Arrays.stream(queryInfo.getOrganIds().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());

+ 9 - 21
mec-web/src/main/java/com/ym/mec/web/controller/education/EduOrganizationController.java

@@ -1,23 +1,18 @@
 package com.ym.mec.web.controller.education;
 
+import com.ym.mec.biz.dal.entity.CooperationOrgan;
+import com.ym.mec.biz.service.CooperationOrganService;
+import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-
-import java.util.List;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.entity.CooperationOrgan;
-import com.ym.mec.biz.service.CooperationOrganService;
-import com.ym.mec.biz.service.OrganizationService;
-import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.entity.HttpResponseResult;
-import com.ym.mec.common.exception.BizException;
+import java.util.List;
 
 @RequestMapping("eduOrganization")
 @Api(tags = "分部服务")
@@ -28,24 +23,17 @@ public class EduOrganizationController extends BaseController {
     private OrganizationService organizationService;
     @Autowired
     private CooperationOrganService cooperationOrganService;
-	@Autowired
-	private SysUserFeignService sysUserFeignService;
 
     @ApiOperation(value = "获取员工所在分部列表")
     @GetMapping("/queryAllOrgan")
-    public Object queryAllOrgan(String organId) throws Exception {
-        return succeed(organizationService.queryEmployeeOrgan(null,organId));
+    public Object queryAllOrgan() throws Exception {
+        return succeed(organizationService.queryEmployeeOrgan());
     }
 
     @ApiOperation(value = "获取员工所在分部列表")
     @GetMapping("/queryEmployeeOrgan")
     public Object queryEmployeeOrgan() throws Exception {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if(sysUser == null){
-			throw new BizException("获取用户信息失败");
-		}
-		Integer userId = sysUser.getId();
-        return succeed(organizationService.queryEmployeeOrgan(userId,null));
+        return succeed(organizationService.queryEmployeeOrgan());
     }
 
     @ApiOperation(value = "根据分部id获取合作单位(学校)列表")

+ 1 - 13
mec-web/src/main/java/com/ym/mec/web/controller/education/EduStudentController.java

@@ -1,7 +1,5 @@
 package com.ym.mec.web.controller.education;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.EduOrganStudentDataDto;
 import com.ym.mec.biz.dal.dto.StatDto;
 import com.ym.mec.biz.dal.entity.Organization;
@@ -10,11 +8,8 @@ import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.StudentService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
-import com.ym.mec.common.exception.BizException;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -38,8 +33,6 @@ public class EduStudentController extends BaseController {
     private StudentService studentService;
     @Autowired
     private OrganizationService organizationService;
-	@Autowired
-	private SysUserFeignService sysUserFeignService;
 
     @ApiOperation(value = "云教练学员数据")
     @GetMapping("/organStudentData")
@@ -50,12 +43,7 @@ public class EduStudentController extends BaseController {
     @ApiOperation(value = "分部云教练学员数据预览")
     @GetMapping("/organStudentOverView")
     public HttpResponseResult<List<EduOrganStudentDataDto>> organStudentOverView() throws Exception {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if(sysUser == null){
-			throw new BizException("获取用户信息失败");
-		}
-		Integer userId = sysUser.getId();
-        List<Organization> organizations = organizationService.queryEmployeeOrgan(userId,null);
+        List<Organization> organizations = organizationService.queryEmployeeOrgan();
         if(CollectionUtils.isEmpty(organizations)){
             return succeed(Collections.emptyList());
         }