Browse Source

课程规则设置

zouxuan 3 years ago
parent
commit
32af91d118

+ 5 - 0
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/filter/UsernameAuthenticationFilter.java

@@ -7,6 +7,7 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ym.mec.common.exception.BizException;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.security.authentication.AuthenticationServiceException;
 import org.springframework.security.authentication.LockedException;
@@ -73,6 +74,10 @@ public class UsernameAuthenticationFilter extends AbstractAuthenticationProcessi
 		if (userInfo == null) {
 			throw new UsernameNotFoundException("404.9");
 		}
+		Integer tenantId = userInfo.getSysUser().getTenantId();
+		if (tenantId == null || tenantId == 0) {
+			throw new BizException("机构信息异常,请联系管理员");
+		}
 	
 //		if (userInfo.getSysUser().getUserType() != SysUserType.SYSTEM && !StringUtils.equalsIgnoreCase(clientId, userInfo.getSysUser().getUserType().getCode())) {
 //			throw new LockedException("登录失败");

+ 5 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/provider/service/DefaultUserDetailsService.java

@@ -3,6 +3,7 @@ package com.ym.mec.auth.core.provider.service;
 import com.ym.mec.auth.api.dto.SysUserInfo;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.service.SysUserService;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.security.AuthUser;
 import com.ym.mec.common.security.SecurityConstants;
 import org.apache.commons.lang3.StringUtils;
@@ -36,7 +37,6 @@ public class DefaultUserDetailsService implements UserDetailsService {
 		if (StringUtils.isBlank(username)) {
 			return null;
 		}
-
 		SysUserInfo userInfo = null;
 
 		if (StringUtils.startsWith(username, SecurityConstants.PHONE_PRINCIPAL_PREFIX)) {
@@ -51,6 +51,10 @@ public class DefaultUserDetailsService implements UserDetailsService {
 		} else if (userInfo.getSysUser().getLockFlag() == 9) {
 			throw new LockedException("账户被锁定");
 		}
+		Integer tenantId = userInfo.getSysUser().getTenantId();
+		if (tenantId == null || tenantId == 0) {
+			throw new BizException("机构信息异常,请联系管理员");
+		}
 
 		List<GrantedAuthority> authorities = null;
 

+ 18 - 12
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysUserDeviceServiceImpl.java

@@ -1,26 +1,28 @@
 package com.ym.mec.auth.service.impl;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.BadCredentialsException;
-import org.springframework.stereotype.Service;
-
 import com.ym.mec.auth.api.entity.SysUserDevice;
 import com.ym.mec.auth.dal.dao.SysUserDeviceDao;
 import com.ym.mec.auth.service.SysUserDeviceService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.web.WebFeignService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
 
 @Service
 public class SysUserDeviceServiceImpl extends BaseServiceImpl<Integer, SysUserDevice>  implements SysUserDeviceService {
 	
 	@Autowired
 	private SysUserDeviceDao sysUserDeviceDao;
+	@Autowired
+	private WebFeignService webFeignService;
 
 	@Override
 	public BaseDAO<Integer, SysUserDevice> getDAO() {
@@ -39,7 +41,6 @@ public class SysUserDeviceServiceImpl extends BaseServiceImpl<Integer, SysUserDe
 
 	@Override
 	public boolean bindDevice(String clientId, Integer userId, String deviceNum) {
-
 		if (StringUtils.equals(clientId, "STUDENT")) {
 			// 检查学生是否绑定了多个设备号
 			List<SysUserDevice> studentDeviceList = queryByUserId(clientId, userId);
@@ -54,7 +55,6 @@ public class SysUserDeviceServiceImpl extends BaseServiceImpl<Integer, SysUserDe
 				if (deviceList.size() >= 5) {
 					throw new BadCredentialsException("当前账号绑定设备过多,请联系主教老师");
 				}
-
 				SysUserDevice sysUserDevice = new SysUserDevice();
 				sysUserDevice.setUserId(userId);
 				sysUserDevice.setDeviceNum(deviceNum);
@@ -63,6 +63,12 @@ public class SysUserDeviceServiceImpl extends BaseServiceImpl<Integer, SysUserDe
 				sysUserDeviceDao.insert(sysUserDevice);
 			}
 		} else {
+			if(StringUtils.equals(clientId, "TEACHER")){
+
+			}
+			if(StringUtils.equals(clientId, "SYSTEM")){
+
+			}
 			// 查询设备号是否已存在
 			List<SysUserDevice> sysUserDeviceList = sysUserDeviceDao.queryByDeviceNum(null, deviceNum);
 

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/BasicUserDto.java

@@ -38,6 +38,16 @@ public class BasicUserDto {
 
     private String subjectIdList;
 
+    private Integer tenantId;
+
+    public Integer getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(Integer tenantId) {
+        this.tenantId = tenantId;
+    }
+
     public Integer getMemberRankSettingId() {
         return memberRankSettingId;
     }

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

@@ -141,6 +141,16 @@ public class VipGroup {
 
 	private int enableDelete;
 
+	private Integer tenantId;
+
+	public Integer getTenantId() {
+		return tenantId;
+	}
+
+	public void setTenantId(Integer tenantId) {
+		this.tenantId = tenantId;
+	}
+
 	public Integer getEnableDelete() {
 		return enableDelete;
 	}

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/GoodsService.java

@@ -78,7 +78,7 @@ public interface GoodsService extends BaseService<Integer, Goods> {
      * @time 11:30
      * @return void
      */
-    void repertoryWarn();
+    void repertoryWarn(Integer tenantId);
 
     /**
      * @describe 给超售商品分配批次

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

@@ -64,6 +64,14 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
     String ADVANCE_LEAVE_HOURS = "advance_leave_hours";
     //教师可调整课程默认时间,开课前{}小时
     String ENABLE_TEACHER_COURSE_ADJUST_DEFAULT_HOURS = "enable_teacher_course_adjust_default_hours";
+    //内部库存预警值
+    String INNER_REPERTORY_WARN_NUM = "inner_repertory_warn_num";
+    //外部库存预警值
+    String OUTER_REPERTORY_WARN_NUM = "outer_repertory_warn_num";
+    //库存预警手机号
+    String REPERTORY_WARN_PHONE = "repertory_warn_phone";
+    //退款周期
+    String REFUND_PERIOD = "refund_period";
 
     public static final String BASE_API_URL = "base_api_url";
 
@@ -125,8 +133,6 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
 
     String MUSIC_GROUP_SETTLEMENT_SINGLE_CLASS_MINUTES = "music_group_settlement_single_class_minutes";
 
-    String REFUND_PERIOD = "refund_period";
-
     /**
      * 可签退时间限制(自然天)
      */

+ 6 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java

@@ -19,6 +19,7 @@ import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.dal.page.GoodsQuery;
 import com.ym.mec.biz.dal.page.GoodsQueryInfo;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -48,9 +49,6 @@ import com.ym.mec.biz.dal.enums.SellStatus;
 import com.ym.mec.biz.dal.enums.StockType;
 import com.ym.mec.biz.dal.enums.TemplateTypeEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
-import com.ym.mec.biz.service.GoodsService;
-import com.ym.mec.biz.service.SysMessageService;
-import com.ym.mec.biz.service.UploadFileService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.UploadReturnBean;
 import com.ym.mec.common.exception.BizException;
@@ -73,7 +71,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 	@Autowired
 	private GoodsProcurementDao goodsProcurementDao;
 	@Autowired
-	private SysConfigDao sysConfigDao;
+	private SysTenantConfigService sysTenantConfigService;
 	@Autowired
 	private SysMessageService sysMessageService;
 	@Autowired
@@ -435,9 +433,9 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 	}
 
 	@Override
-	public void repertoryWarn() {
+	public void repertoryWarn(Integer tenantId) {
 		//预警手机号
-		String repertoryWarnPhone = sysConfigDao.findConfigValue("repertory_warn_phone");
+		String repertoryWarnPhone = sysTenantConfigService.getTenantConfigValue(SysConfigService.REPERTORY_WARN_PHONE,tenantId);
 		if(StringUtils.isEmpty(repertoryWarnPhone)){
 			return;
 		}
@@ -448,7 +446,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		Map<Integer, String> receivers = new HashMap<>(1);
 		receivers.put(sysUser.getUserId(), repertoryWarnPhone);
 		//内部库存预警
-		String innerRepertoryWarnNum = sysConfigDao.findConfigValue("inner_repertory_warn_num");
+		String innerRepertoryWarnNum = sysTenantConfigService.getTenantConfigValue(SysConfigService.INNER_REPERTORY_WARN_NUM,sysUser.getTenantId());
 		if(StringUtils.isNotEmpty(innerRepertoryWarnNum)){
 			String goodsNames = goodsDao.getInnerRepertoryWarnName(innerRepertoryWarnNum);
 			if(StringUtils.isNotEmpty(goodsNames)){
@@ -458,7 +456,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		}
 
 		//外部库存预警
-		String outerRepertoryWarnNum = sysConfigDao.findConfigValue("outer_repertory_warn_num");
+		String outerRepertoryWarnNum = sysTenantConfigService.getTenantConfigValue(SysConfigService.OUTER_REPERTORY_WARN_NUM,sysUser.getTenantId());
 		if(StringUtils.isNotEmpty(outerRepertoryWarnNum)){
 			String goodsNames = goodsDao.getOuterRepertoryWarnName(outerRepertoryWarnNum);
 			if(StringUtils.isNotEmpty(goodsNames)){

+ 9 - 56
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -32,6 +32,7 @@ import java.util.stream.Collectors;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.service.*;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -65,30 +66,6 @@ import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
 import com.ym.mec.biz.dal.page.MusicMemberQueryInfo;
 import com.ym.mec.biz.event.source.GroupEventSource;
-import com.ym.mec.biz.service.ClassGroupService;
-import com.ym.mec.biz.service.ClassGroupStudentMapperService;
-import com.ym.mec.biz.service.CloudTeacherOrderService;
-import com.ym.mec.biz.service.ContractService;
-import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
-import com.ym.mec.biz.service.GoodsService;
-import com.ym.mec.biz.service.ImGroupMemberService;
-import com.ym.mec.biz.service.ImGroupService;
-import com.ym.mec.biz.service.ImUserFriendService;
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
-import com.ym.mec.biz.service.MusicGroupService;
-import com.ym.mec.biz.service.MusicGroupSubjectGoodsGroupService;
-import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
-import com.ym.mec.biz.service.PayService;
-import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
-import com.ym.mec.biz.service.StudentPaymentOrderService;
-import com.ym.mec.biz.service.StudentPaymentRouteOrderService;
-import com.ym.mec.biz.service.StudentRegistrationService;
-import com.ym.mec.biz.service.StudentService;
-import com.ym.mec.biz.service.SysConfigService;
-import com.ym.mec.biz.service.SysCouponCodeService;
-import com.ym.mec.biz.service.SysMessageService;
-import com.ym.mec.biz.service.SysUserCashAccountDetailService;
-import com.ym.mec.biz.service.SysUserCashAccountService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.entity.ImGroupMember;
@@ -134,79 +111,54 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     private MusicGroupPurchaseListDao musicGroupPurchaseListDao;
     @Autowired
     private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
-
     @Autowired
     private ClassGroupStudentMapperDao classGroupStudentMapperDao;
-
     @Autowired
     private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;
-
     @Autowired
     private StudentPaymentOrderDao studentPaymentOrderDao;
-
     @Autowired
     private SysUserCashAccountService sysUserCashAccountService;
-
     @Autowired
     private SysUserCashAccountDetailService sysUserCashAccountDetailService;
-
     @Autowired
     private MusicGroupPaymentCalenderStudentDetailDao musicGroupPaymentCalenderStudentDetailDao;
-
     @Autowired
     private MusicGroupQuitDao musicGroupQuitDao;
-
     @Autowired
     private StudentRegistrationDao studentRegistrationDao;
-
     @Autowired
     private CourseScheduleDao courseScheduleDao;
-
     @Autowired
     private ClassGroupDao classGroupDao;
-
     @Autowired
     private OrganizationDao organizationDao;
-
     @Autowired
     private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
-
     @Autowired
     private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
-
     @Autowired
     private CooperationOrganDao cooperationOrganDao;
-
     @Autowired
     private TeacherAttendanceDao teacherAttendanceDao;
-
     @Autowired
     private StudentPaymentOrderService studentPaymentOrderService;
-
     @Autowired
     private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
-
     @Autowired
     private PayService payService;
-
     @Autowired
     private SysUserFeignService sysUserFeignService;
-
     @Autowired
     private EmployeeDao employeeDao;
-
     @Autowired
     private SysMessageService sysMessageService;
-
     @Autowired
     private SysConfigDao sysConfigDao;
-
     @Autowired
-    private SysTenantConfigDao sysTenantConfigDao;
-
+    private SysTenantConfigService sysTenantConfigService;
     @Autowired
     private ClassGroupService classGroupService;
-
     @Autowired
     private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
     @Autowired
@@ -527,7 +479,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             throw new BizException("操作失败:只有乐团在[{}]状态才能操作", MusicGroupStatusEnum.PRE_APPLY.getMsg());
         }
         if (isCheckStudentNum) {
-            String configValue = sysTenantConfigDao.getConfigValue(SysConfigService.MUSIC_MIN_STUDENT_NUM, musicGroup.getTenantId());
+            String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.MUSIC_MIN_STUDENT_NUM, musicGroup.getTenantId());
             if(StringUtils.isNotEmpty(configValue)){
                 Integer minStudentNum = Integer.parseInt(configValue);
                 // 查询乐团已报名人数
@@ -1461,7 +1413,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             throw new BizException("乐团机构信息异常,请联系管理员");
         }
         //预报名开关
-        String configValue = sysTenantConfigDao.getConfigValue(SysConfigService.MUSIC_PRE_APPLY_OPEN_FLAG, musicGroup.getTenantId());
+        String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.MUSIC_PRE_APPLY_OPEN_FLAG, musicGroup.getTenantId());
         if(StringUtils.isNotEmpty(configValue) && configValue.equals(1)){
             //记录操作日志
             musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核通过(审核中 -> 预报名)", sysUser.getId(), ""));
@@ -1686,14 +1638,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }*/
         //获取当前乐团所有已报名学员
         List<StudentRegistration> registrations = studentRegistrationDao.findClassGroupStu(musicGroupId, null);
-        if (musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN) {
+        String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.REFUND_PERIOD, musicGroup.getTenantId());
+        if (StringUtils.isNotEmpty(configValue) && musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN) {
             if (registrations != null && registrations.size() > 0) {
                 Map<Integer, String> map = new HashMap<>(registrations.size());
                 registrations.forEach(e -> {
                     map.put(e.getUserId(), e.getUserId().toString());
                 });
                 sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_CLOSE,
-                        map, null, 0, "1", "STUDENT", musicGroup.getName(), sysConfigDao.findConfigValue(SysConfigService.REFUND_PERIOD));
+                        map, null, 0, "1", "STUDENT", musicGroup.getName(), configValue);
             }
         }
         //将学生退团
@@ -3917,9 +3870,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         Integer paymentStudentNum = studentRegistrationDao.getPaymentStudentNum(musicGroupId);
 
         //若乐团新建团,则操作【确认开团】时,若【已缴费】学员达到98人,则无需对【未缴费】学员新增回访
-        String configValue = sysTenantConfigDao.getConfigValue(SysConfigService.NEW_MUSIC_PAYMENT_STUDENT_NUM, musicGroup.getTenantId());
+        String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.NEW_MUSIC_PAYMENT_STUDENT_NUM, musicGroup.getTenantId());
         //若乐团不是新建团,则操作【确认开团】时,若【已缴费】学员达到58人,则无需对【未缴费】学员新增回访
-        String configValue1 = sysTenantConfigDao.getConfigValue(SysConfigService.OLD_MUSIC_PAYMENT_STUDENT_NUM, musicGroup.getTenantId());
+        String configValue1 = sysTenantConfigService.getTenantConfigValue(SysConfigService.OLD_MUSIC_PAYMENT_STUDENT_NUM, musicGroup.getTenantId());
         if ((StringUtils.isNotEmpty(configValue) && cooperationMusicGroupNum <= 0 && paymentStudentNum < Integer.parseInt(configValue)) ||
                 (StringUtils.isNotEmpty(configValue1) && cooperationMusicGroupNum > 0 && paymentStudentNum < Integer.parseInt(configValue1))) {
             checkStudentVisit(musicGroupId);

+ 14 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -115,6 +115,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	@Autowired
 	private SysConfigDao sysConfigDao;
 	@Autowired
+	private SysTenantConfigService sysTenantConfigService;
+	@Autowired
 	private SysUserCashAccountDetailService sysUserCashAccountDetailService;
 	@Autowired
 	private SysMessageService sysMessageService;
@@ -4000,12 +4002,17 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				map,null,0,"1","TEACHER",vipGroup.getName());
 	}
 
-	private void stopVipPush(Long vipGroupId,String vipGroupName){
-		String refundPeriod = sysConfigDao.findConfigValue(SysConfigService.REFUND_PERIOD);
-		Map<Integer,String> map1 = MapUtil.convertMybatisMap(classGroupStudentMapperDao.queryStudentIdMap(vipGroupId));
-		if(map1 != null && map1.size() > 0){
-			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,MessageTypeEnum.STUDENT_PUSH_VIP_STOP,
-					map1,null,0,null,"STUDENT",vipGroupName,refundPeriod);
+	private void stopVipPush(Long vipGroupId,String vipGroupName,Integer tenantId){
+		if(tenantId == null){
+			throw new BizException("课程机构信息异常");
+		}
+		String refundPeriod = sysTenantConfigService.getTenantConfigValue(SysConfigService.REFUND_PERIOD, tenantId);
+		if(StringUtils.isNotEmpty(refundPeriod)){
+			Map<Integer,String> map1 = MapUtil.convertMybatisMap(classGroupStudentMapperDao.queryStudentIdMap(vipGroupId));
+			if(map1 != null && map1.size() > 0){
+				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,MessageTypeEnum.STUDENT_PUSH_VIP_STOP,
+						map1,null,0,null,"STUDENT",vipGroupName,refundPeriod);
+			}
 		}
 //		老师推送消息
 		Map<Integer,String> map2 = MapUtil.convertMybatisMap(classGroupStudentMapperDao.queryTeacherIdMap(vipGroupId));
@@ -4588,7 +4595,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			for (VipGroup noCreateSuccessVipGroup : noCreateSuccessVipGroups) {
 				//推送消息
 				if(noCreateSuccessVipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)) {
-					stopVipPush(noCreateSuccessVipGroup.getId(), noCreateSuccessVipGroup.getName());
+					stopVipPush(noCreateSuccessVipGroup.getId(), noCreateSuccessVipGroup.getName(),noCreateSuccessVipGroup.getTenantId());
 				}
 			}
 		}

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

@@ -397,6 +397,7 @@
         <result column="phone_" property="phone"/>
         <result column="care_package_" property="carePackage"/>
         <result column="come_on_package_" property="comeOnPackage"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <select id="queryUserGroups" resultMap="com.ym.mec.biz.dal.dao.ClassGroupDao.imGroupModel">

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

@@ -1373,7 +1373,7 @@
     </select>
     <select id="findUserByPhone" resultMap="com.ym.mec.biz.dal.dao.MusicGroupDao.BasicUserDto">
         SELECT username_,id_ user_id_,avatar_ head_url_,
-        gender_,user_type_
+        gender_,user_type_,tenant_id_
         FROM sys_user WHERE phone_ = #{phone}
     </select>
     <select id="existUser" resultType="java.lang.Boolean">

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

@@ -47,6 +47,7 @@
         <result column="educational_teacher_id_" property="educationalTeacherId"/>
         <result column="vip_group_category_name_" property="vipGroupCategoryName"/>
         <result column="educational_teacher_name_" property="educationalTeacherName" />
+        <result column="tenant_id_" property="tenantId" />
     </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.entity.School" id="School">
@@ -238,12 +239,12 @@
          update_time_,teacher_school_id_,online_classes_num_,offline_classes_num_,registration_start_time_,
          name_,organ_id_list_,vip_group_activity_id_,group_status_,online_classes_unit_price_,offline_classes_unit_price_,
          total_price_,give_teach_mode_,vip_group_category_id_,organ_id_,stop_reason_,memo_,audit_status_,courses_start_date,
-         course_schedules_json_,student_id_list_)
+         course_schedules_json_,student_id_list_,tenant_id_)
         VALUES(#{id},#{userId},#{singleClassMinutes},#{paymentExpireDate},#{coursesExpireDate},now(),now(),#{teacherSchoolId},
                #{onlineClassesNum},#{offlineClassesNum},#{registrationStartTime},#{name},#{organIdList},#{vipGroupActivityId},
                #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{onlineClassesUnitPrice},#{offlineClassesUnitPrice},
                #{totalPrice},#{giveTeachMode},#{vipGroupCategoryId},#{organId},#{stopReason},#{memo},
-               #{auditStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{courseStartDate},#{courseSchedulesJson},#{studentIdList})
+               #{auditStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{courseStartDate},#{courseSchedulesJson},#{studentIdList},#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->

+ 6 - 4
mec-client-api/src/main/java/com/ym/mec/web/WebFeignService.java

@@ -1,12 +1,11 @@
 package com.ym.mec.web;
 
+import com.ym.mec.common.config.FeignConfiguration;
+import com.ym.mec.web.fallback.WebFeignServiceFallback;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 
-import com.ym.mec.common.config.FeignConfiguration;
-import com.ym.mec.web.fallback.WebFeignServiceFallback;
-
 @FeignClient(name = "web-server", contextId = "WebFeignService", configuration = FeignConfiguration.class, fallback = WebFeignServiceFallback.class)
 public interface WebFeignService {
 
@@ -14,7 +13,7 @@ public interface WebFeignService {
 	Boolean createCashAccount(@RequestParam("userId") Integer userId);
 
 	@RequestMapping(value = "api/queryTeacherOrganId")
-	public Integer queryTeacherOrganId(@RequestParam("userId") Integer userId);
+	Integer queryTeacherOrganId(@RequestParam("userId") Integer userId);
 
 	@RequestMapping(value = "api/isPurchasedPracticeCourse")
 	Boolean isPurchasedPracticeCourse(@RequestParam("userId") Integer userId);
@@ -24,4 +23,7 @@ public interface WebFeignService {
 
 	@RequestMapping(value = "api/queryOrganIdByUserId")
 	String queryOrganIdByUserId(@RequestParam("userId") Integer userId, @RequestParam("clientId") String clientId);
+
+	@RequestMapping(value = "api/getTenantConfigValue")
+	String getTenantConfigValue(@RequestParam("tenantId") Integer tenantId, @RequestParam("paramName") String paramName);
 }

+ 6 - 0
mec-client-api/src/main/java/com/ym/mec/web/fallback/WebFeignServiceFallback.java

@@ -3,6 +3,7 @@ package com.ym.mec.web.fallback;
 import org.springframework.stereotype.Component;
 
 import com.ym.mec.web.WebFeignService;
+import org.springframework.web.bind.annotation.RequestParam;
 
 @Component
 public class WebFeignServiceFallback implements WebFeignService {
@@ -31,4 +32,9 @@ public class WebFeignServiceFallback implements WebFeignService {
 	public String queryOrganIdByUserId(Integer userId, String clientId) {
 		return null;
 	}
+
+	@Override
+	public String getTenantConfigValue(Integer tenantId,String paramName){
+		return null;
+	}
 }

+ 8 - 7
mec-web/src/main/java/com/ym/mec/web/controller/APIController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.service.SysTenantConfigService;
 import io.swagger.annotations.Api;
 
 import org.apache.commons.lang3.StringUtils;
@@ -28,24 +29,20 @@ public class APIController extends BaseController {
 
 	@Autowired
 	private SysUserCashAccountDao sysUserCashAccountDao;
-	
 	@Autowired
 	private TeacherDao teacherDao;
-	
 	@Autowired
 	private EmployeeDao employeeDao;
-	
 	@Autowired
 	private PracticeLessonApplyService practiceLessonApplyService;
-	
 	@Autowired
 	private PracticeGroupService practiceGroupService;
-	
 	@Autowired
 	private ImGroupService imGroupService;
-	
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
+	@Autowired
+	private SysTenantConfigService sysTenantConfigService;
 
 	@GetMapping("/createCashAccount")
 	public Boolean createCashAccount(Integer userId) {
@@ -79,9 +76,13 @@ public class APIController extends BaseController {
 		return imGroupService.updateNickName(userId,nickName);
 	}
 
+	@GetMapping("/getTenantConfigValue")
+	public String getTenantConfigValue(Integer tenantId,String paramName) {
+		return sysTenantConfigService.getTenantConfigValue(paramName,tenantId);
+	}
+
 	@GetMapping("/queryOrganIdByUserId")
 	public String queryOrganIdByUserId(Integer userId, String clientId) {
-
 		if (StringUtils.equalsIgnoreCase("system", clientId) || StringUtils.equalsIgnoreCase("education", clientId)) {
 			Employee employee = employeeDao.get(userId);
 			if (employee != null) {

+ 8 - 1
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -152,7 +152,14 @@ public class TaskController extends BaseController {
 	@GetMapping(value = "/repertoryWarn")
 	// 商品库存预警
 	public void repertoryWarn(){
-		goodsService.repertoryWarn();
+		Map<String,Object> paramMap = new HashMap<>(1);
+		paramMap.put("state",1);
+		List<TenantInfo> tenantInfos = tenantInfoDao.queryList(paramMap);
+		if(tenantInfos != null && tenantInfos.size() > 0){
+			for (TenantInfo tenantInfo : tenantInfos) {
+				goodsService.repertoryWarn(tenantInfo.getId());
+			}
+		}
 	}
 
 	@GetMapping(value = "/refreshUserMusicGroupPaymentStatusTask")