Просмотр исходного кода

Merge branch 'master' of http://git.dayaedu.com/yonge/edu-saas

yonge 5 лет назад
Родитель
Сommit
e4b40488a1
27 измененных файлов с 201 добавлено и 100 удалено
  1. 1 6
      edu-im/edu-im-server/src/main/java/com/keao/edu/im/mec/im/IMHelper.java
  2. 17 29
      edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java
  3. 2 2
      edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/RoomService.java
  4. 8 3
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/SysConfigDao.java
  5. 11 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dto/NeedCheckingDetailDto.java
  6. 10 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dto/RoomStudentListDto.java
  7. 23 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/entity/Organization.java
  8. 11 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/entity/Teacher.java
  9. 2 1
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/enums/SettlementTypeEnum.java
  10. 2 1
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/enums/TeacherSettlementTypeEnum.java
  11. 2 2
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/NotifyCallback.java
  12. 8 1
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/SysConfigService.java
  13. 3 2
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamCertificationServiceImpl.java
  14. 2 2
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamOrganizationRelationServiceImpl.java
  15. 4 6
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationServiceImpl.java
  16. 1 1
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java
  17. 6 8
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java
  18. 3 2
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/PayServiceImpl.java
  19. 1 1
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ShortUrlServiceImpl.java
  20. 21 2
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/SysConfigServiceImpl.java
  21. 5 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/TenantInfoServiceImpl.java
  22. 2 1
      edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamCertificationMapper.xml
  23. 2 1
      edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml
  24. 24 15
      edu-user/edu-user-biz/src/main/resources/config/mybatis/OrganizationMapper.xml
  25. 17 8
      edu-user/edu-user-biz/src/main/resources/config/mybatis/SysConfigMapper.xml
  26. 6 2
      edu-user/edu-user-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  27. 7 4
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/SysConfigController.java

+ 1 - 6
edu-im/edu-im-server/src/main/java/com/keao/edu/im/mec/im/IMHelper.java

@@ -315,13 +315,12 @@ public class IMHelper {
     /**
      * 更改录制布局
      * @param roomId
-     * @param registrationId
      * @param roomMembers
      * @return
      * @throws Exception
      */
     @Async
-    public IMApiResultInfo configRecord(String roomId, Long registrationId, List<RoomMember> roomMembers) throws Exception {
+    public IMApiResultInfo configRecord(String roomId, List<RoomMember> roomMembers) throws Exception {
         if (roomId == null) {
             throw new IllegalArgumentException("Paramer 'roomId' is required");
         }
@@ -360,13 +359,9 @@ public class IMHelper {
 
         String body = json.toJSONString();
 
-        Thread.sleep(1000l);
         HttpURLConnection conn = httpHelper.createIMRtcPostHttpConnection("/rtc/record/config.json", "application/json",roomId);
         httpHelper.setBodyParameter(body, conn);
         IMApiResultInfo resultInfo = JSON.parseObject(httpHelper.returnResult(conn, body), IMApiResultInfo.class);
-        if(resultInfo.getResultCode() == 10000){
-            redisTemplate.opsForValue().set(resultInfo.getRecordId(),registrationId.toString());
-        }
         return resultInfo;
     }
 

+ 17 - 29
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java

@@ -84,30 +84,17 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    public void configRecord(String roomId,String userId) throws Exception {
-        ExamRoom examRoom = eduUserFeignService.getExamRoom(Integer.parseInt(roomId));
-        RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
-//        imHelper.configRecord(roomId,userId);
+    public void configRecord(String roomId) throws Exception {
+        List<RoomMember> roomMembers = roomMemberDao.findByRid(roomId);
+        if(roomMembers.size() > 0){
+            imHelper.configRecord(roomId,roomMembers);
+        }
     }
 
     @Override
-    public void startRecord(String roomId,String userId) throws Exception {
-
-        /*ExamRoom examRoom = eduUserFeignService.getExamRoom(Integer.parseInt(roomId));
-        boolean isAssistant = false;
-        if (StringUtils.isNotEmpty(examRoom.getAssistantTeacherUserIdList())){
-            List<String> list = Arrays.asList(examRoom.getAssistantTeacherUserIdList().split(","));
-            if(list.contains(userId)){
-                isAssistant = true;
-            }
-        }
-        if(sysUser.getId().equals(examRoom.getMainTeacherUserId())){
-            return;
-        }else if(isAssistant){
-            return;
-        }else {
-            imHelper.startRecord(userId.toString(), roomId);
-        }*/
+    public void startRecord(String roomId,String userId,String extra) throws Exception {
+        List<RoomMember> roomMembers = roomMemberDao.findByRid(roomId);
+        imHelper.startRecord(userId,roomId,null,roomMembers);
     }
 
     @Override
@@ -1492,10 +1479,9 @@ public class RoomServiceImpl implements RoomService {
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     public boolean statusSync(ChannelStateNotify notify) throws Exception {
-//        String roomId = notify.getChannelId();
-//        String userId = notify.getUserId();
-//        ExamRoom examRoom = eduUserFeignService.getExamRoom(Integer.parseInt(roomId));
-//        RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
+        String roomId = notify.getChannelId();
+        String userId = notify.getUserId();
+        RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
         if(notify.getEvent() == 1){
             //同步房间信息
         }else if(notify.getEvent() == 2){
@@ -1504,9 +1490,11 @@ public class RoomServiceImpl implements RoomService {
             //房间销毁
         }else if(notify.getEvent() == 11){
             //成员加入
-            /*if(roomMember.getRole() != 3){
-                this.configRecord(roomId,userId);
-            }*/
+            if(roomMember.getRole() != 3){
+                this.configRecord(roomId);
+            }else {
+                this.startRecord(roomId,userId,notify.getTimestamp() + "");
+            }
         }else if(notify.getEvent() == 12){
             //成员退出
             /*if(roomMember.getRole() != 3){
@@ -1514,7 +1502,7 @@ public class RoomServiceImpl implements RoomService {
             }else {
                 this.stopRecord(roomId,userId);
             }*/
-            this.leaveRoom(null,notify.getChannelId(),notify.getUserId());
+            this.leaveRoom(null,roomId,userId);
         }else if(notify.getEvent() == 20){
             //资源发生变动
         }

+ 2 - 2
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/RoomService.java

@@ -19,9 +19,9 @@ public interface RoomService {
 
     void roomQuery(String roomId) throws Exception;
 
-    void configRecord(String roomId,String userId) throws Exception;
+    void configRecord(String roomId) throws Exception;
 
-    void startRecord(String roomId,String userId) throws Exception;
+    void startRecord(String roomId,String userId,String extra) throws Exception;
 
     void stopRecord(String userId,String roomId) throws Exception;
 

+ 8 - 3
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/SysConfigDao.java

@@ -3,6 +3,7 @@ package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.common.entity.SysConfig;
+import org.apache.ibatis.annotations.Param;
 
 public interface SysConfigDao extends BaseDAO<Long, SysConfig> {
 
@@ -13,13 +14,17 @@ public interface SysConfigDao extends BaseDAO<Long, SysConfig> {
      * @return com.keao.edu.biz.dal.entity.SysConfig
      * @describe 根据配置名称获取配置信息
      */
-    SysConfig findByParamName(String paramName);
+    SysConfig getByParamName(@Param("paramName") String paramName, @Param("tenantId") String tenantId);
 
     /**
      * 获取value
      * @param paramName
      * @return
      */
-    String findConfigValue(String paramName);
-	
+    String getConfigValue(@Param("paramName") String paramName, @Param("tenantId") String tenantId);
+
+    /**
+     * 初始化系统参数
+     */
+    void initSysConfig(String tenantId);
 }

+ 11 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dto/NeedCheckingDetailDto.java

@@ -43,6 +43,17 @@ public class NeedCheckingDetailDto {
     @ApiModelProperty(value = "注意事项")
     private String desc;
 
+    @ApiModelProperty(value = "机构")
+    private String tenantId;
+
+    public String getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(String tenantId) {
+        this.tenantId = tenantId;
+    }
+
     public Integer getRecordFlag() {
         return recordFlag;
     }

+ 10 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dto/RoomStudentListDto.java

@@ -19,6 +19,8 @@ public class RoomStudentListDto {
     @ApiModelProperty(value = "签到时间(为空代表未签到)")
     private String signInTime;
 
+    private String tenantId;
+
     @ApiModelProperty(value = "级别")
     private Integer level;
 
@@ -31,6 +33,14 @@ public class RoomStudentListDto {
     @ApiModelProperty(value = "学员编号")
     private Integer studentId;
 
+    public String getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(String tenantId) {
+        this.tenantId = tenantId;
+    }
+
     public Integer getFinishedExam() {
         return finishedExam;
     }

+ 23 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/entity/Organization.java

@@ -6,6 +6,8 @@ import com.keao.edu.user.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.math.BigDecimal;
+
 /**
  * 对应数据库表(organ):
  */
@@ -33,6 +35,9 @@ public class Organization {
 	@ApiModelProperty(value = "分润金额",required = false)
 	private java.math.BigDecimal shareProfitAmount;
 
+	@ApiModelProperty(value = "补贴",required = false)
+	private java.math.BigDecimal subsidy;
+
 	@ApiModelProperty(value = "层级")
 	private Integer level;
 
@@ -52,8 +57,26 @@ public class Organization {
 
 	private String tenantId;
 
+	private Integer lockFlag;
+
 	private SysUser sysUser;
 
+	public BigDecimal getSubsidy() {
+		return subsidy;
+	}
+
+	public void setSubsidy(BigDecimal subsidy) {
+		this.subsidy = subsidy;
+	}
+
+	public Integer getLockFlag() {
+		return lockFlag;
+	}
+
+	public void setLockFlag(Integer lockFlag) {
+		this.lockFlag = lockFlag;
+	}
+
 	public Organization() {
 	}
 

+ 11 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/entity/Teacher.java

@@ -27,6 +27,9 @@ public class Teacher {
 	@ApiModelProperty(value = "薪酬",required = false)
 	private java.math.BigDecimal salary;
 
+	@ApiModelProperty(value = "补贴",required = false)
+	private java.math.BigDecimal subsidy;
+
 	@ApiModelProperty(value = "是否删除",required = false)
 	private Integer delFlag;
 
@@ -58,6 +61,14 @@ public class Teacher {
 	
 	private String certificateNo;
 
+	public BigDecimal getSubsidy() {
+		return subsidy;
+	}
+
+	public void setSubsidy(BigDecimal subsidy) {
+		this.subsidy = subsidy;
+	}
+
 	public Integer getOrganId() {
 		return organId;
 	}

+ 2 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/enums/SettlementTypeEnum.java

@@ -9,7 +9,8 @@ import com.keao.edu.common.enums.BaseEnum;
 public enum  SettlementTypeEnum implements BaseEnum<String, SettlementTypeEnum> {
 
     INCOME_RATIO("INCOME_RATIO", "收入比例"),
-    PEOPLE_NUM("PEOPLE_NUM", "人数");
+    PEOPLE_NUM("PEOPLE_NUM", "人数"),
+    SUBSIDY_NUM("SUBSIDY_NUM", "组合(补贴+人数)");
 
     private String code;
 

+ 2 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/enums/TeacherSettlementTypeEnum.java

@@ -9,7 +9,8 @@ import com.keao.edu.common.enums.BaseEnum;
 public enum TeacherSettlementTypeEnum implements BaseEnum<String, TeacherSettlementTypeEnum> {
 
     SINGLE("SINGLE", "单次结算"),
-    PEOPLE_NUM("PEOPLE_NUM", "人数");
+    PEOPLE_NUM("PEOPLE_NUM", "人数"),
+    SUBSIDY_NUM("SUBSIDY_NUM", "组合(补贴+人数)");
 
     private String code;
 

+ 2 - 2
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/NotifyCallback.java

@@ -22,7 +22,7 @@ public class NotifyCallback implements MQTTCallbackHandler {
     @Autowired
     private ExamRegistrationPaymentService examRegistrationPaymentService;
     @Autowired
-    private SysConfigDao sysConfigDao;
+    private SysConfigService sysConfigService;
 
 
     private static NotifyCallback notifyCallback;
@@ -30,7 +30,7 @@ public class NotifyCallback implements MQTTCallbackHandler {
     @PostConstruct
     public void init() {
         notifyCallback = this;
-        String baseApiUrl = notifyCallback.sysConfigDao.findConfigValue("base_api_url");
+        String baseApiUrl = notifyCallback.sysConfigService.findConfigValue("base_api_url","0");
         Adapay.setDeviceID(baseApiUrl);
     }
 

+ 8 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/SysConfigService.java

@@ -15,5 +15,12 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
      * @params paramName
      * @describe 根据配置名称获取配置信息
      */
-    SysConfig findByParamName(String paramName);
+    SysConfig findByParamName(String paramName,String tenantId);
+
+    String findConfigValue(String paramName,String tenantId);
+
+    /**
+     * 初始化机构系统参数
+     */
+    void initSysConfig(String tenantId);
 }

+ 3 - 2
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamCertificationServiceImpl.java

@@ -14,6 +14,7 @@ import com.keao.edu.user.entity.StudentExamResult;
 import com.keao.edu.user.entity.Subject;
 import com.keao.edu.user.service.ExamCertificationService;
 import com.keao.edu.user.service.StudentService;
+import com.keao.edu.user.service.SysConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -38,7 +39,7 @@ public class ExamCertificationServiceImpl extends BaseServiceImpl<Long, ExamCert
 	@Autowired
 	private StudentExamResultDao studentExamResultDao;
 	@Autowired
-	private SysConfigDao sysConfigDao;
+	private SysConfigService sysConfigService;
 
 	@Override
 	public BaseDAO<Long, ExamCertification> getDAO() {
@@ -78,7 +79,7 @@ public class ExamCertificationServiceImpl extends BaseServiceImpl<Long, ExamCert
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		Integer waitNum = examRoomStudentRelationDao.sumWaitNum(needCheckingDetailDto.getExamRoomId(),signInTime,sysUser.getId(),needCheckingDetailDto.getExamRoomStudentRelationId());
 		needCheckingDetailDto.setWaitNum(waitNum);
-		needCheckingDetailDto.setDesc(sysConfigDao.findConfigValue("exam_room_desc"));
+		needCheckingDetailDto.setDesc(sysConfigService.findConfigValue("exam_room_desc",needCheckingDetailDto.getTenantId()));
 		return needCheckingDetailDto;
 	}
 

+ 2 - 2
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamOrganizationRelationServiceImpl.java

@@ -133,7 +133,7 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 			throw new BizException("合作单位信息错误");
 		}
 
-		SysConfig baseUrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_H5_URL);
+		SysConfig baseUrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_H5_URL,examinationBasic.getTenantId());
 		String baseUrl="";
 		if(Objects.nonNull(baseUrlConfig)){
 			baseUrl=baseUrlConfig.getParanValue();
@@ -315,7 +315,7 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 			throw new BizException("考级信息错误");
 		}
 
-		SysConfig baseUrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_H5_URL);
+		SysConfig baseUrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_H5_URL,examinationBasic.getTenantId());
 		String baseUrl="";
 		if(Objects.nonNull(baseUrlConfig)){
 			baseUrl=baseUrlConfig.getParanValue();

+ 4 - 6
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationServiceImpl.java

@@ -52,7 +52,7 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
     @Autowired
     private IdGeneratorService idGeneratorService;
     @Autowired
-    private SysConfigDao sysConfigDao;
+    private SysConfigService sysConfigService;
     @Autowired
     private ExamRegistrationPaymentService examRegistrationPaymentService;
     @Autowired
@@ -63,8 +63,6 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
     private SysUserDao sysUserDao;
     @Autowired
     private SysUserFeignService sysUserFeignService;
-    @Autowired
-    private SysConfigService sysConfigService;
 
     @Override
     public BaseDAO<Long, ExamRegistration> getDAO() {
@@ -145,7 +143,7 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
         examRegistrationPaymentService.insert(examRegistrationPayment);
 
         HashMap<String, Object> rpMap = new HashMap<>();
-        String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
+        String baseApiUrl = sysConfigService.findConfigValue("base_api_url",examinationBasic.getTenantId());
         Map<String, Object> payMap = payService.getPayMap(
                 amount,
                 orderNo,
@@ -289,7 +287,7 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
         er.setStatus(status);
         er.setMemo(memo);
 
-        SysConfig baseUrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_H5_URL);
+        SysConfig baseUrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_H5_URL,er.getTenantId());
         String baseUrl="";
         if(Objects.nonNull(baseUrlConfig)){
             baseUrl=baseUrlConfig.getParanValue();
@@ -362,7 +360,7 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
             throw new BizException("项目不在报名中,请核对");
         }
         Map<String, Object> rpMap = new HashMap<>();
-        String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
+        String baseApiUrl = sysConfigService.findConfigValue("base_api_url",examinationBasic.getTenantId());
         Map<String, Object> payMap = payService.getPayMap(
                 order.getTransAmount(),
                 orderNo,

+ 1 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -462,7 +462,7 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 		List<ExamCertification> examCertifications=new ArrayList<>();
 		List<StudentExamResult> studentExamResults=new ArrayList<>();
 
-		SysConfig baseH5UrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_H5_URL);
+		SysConfig baseH5UrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_H5_URL,exam.getTenantId());
 		String baseH5Url = "";
 		if(Objects.nonNull(baseH5UrlConfig)){
 			baseH5Url = baseH5UrlConfig.getParanValue();

+ 6 - 8
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -68,7 +68,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
 	@Autowired
-	private SysConfigDao sysConfigDao;
+	private SysConfigService sysConfigService;
 	@Autowired
 	private ExaminationBasicDao examinationBasicDao;
 	@Autowired
@@ -78,8 +78,6 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	@Autowired
 	private IdGeneratorService idGeneratorService;
 	@Autowired
-	private SysConfigService sysConfigService;
-	@Autowired
 	private ShortUrlService shortUrlService;
 
 	@Override
@@ -201,7 +199,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		if(!CollectionUtils.isEmpty(studentExamResults)){
 			studentExamResultDao.batchInsert(studentExamResults);
 			ExaminationBasic exam = examinationBasicDao.get(examRoom.getExaminationBasicId());
-			SysConfig baseH5UrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_H5_URL);
+			SysConfig baseH5UrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_H5_URL,examinationBasic.getTenantId());
 			String baseH5Url = "";
 			if(Objects.nonNull(baseH5UrlConfig)){
 				baseH5Url = baseH5UrlConfig.getParanValue();
@@ -490,7 +488,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 				}
 			}
 			//当等待人数到指定数值时,推送准备考试消息
-			int actionExamPush = Integer.parseInt(sysConfigDao.findConfigValue("action_exam_push"));
+			int actionExamPush = Integer.parseInt(sysConfigService.findConfigValue("action_exam_push",studentExamResult.getTenantId()));
 			if(actionExamPush != 0 && roomStudentListDtos.size() > actionExamPush){
 				RoomStudentListDto studentListDto = roomStudentListDtos.get(actionExamPush - 1);
 				if(studentListDto.getFinishedExam() == 3){
@@ -568,7 +566,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 
 
 		StuRecordDetailDto stuRecordDetailDto = examRegistrationDao.getStuRecordDetail(examRegistrationId);
-		int recordMinutes = Integer.parseInt(sysConfigDao.findConfigValue("record_minutes"));
+		int recordMinutes = Integer.parseInt(sysConfigService.findConfigValue("record_minutes",studentExamResult.getTenantId()));
 		Date date = DateUtil.addMinutes(stuRecordDetailDto.getRecordStartTime(),recordMinutes);
 		stuRecordDetailDto.setExamEndTime(date);
 		int secondsBetween = DateUtil.secondsBetween(new Date(),date);
@@ -579,7 +577,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		stuRecordDetailDto.setRecordTime(recordMinutes);
 		stuRecordDetailDto.setExamRegistrationId(examRegistrationId);
 		stuRecordDetailDto.setSongJson(stuRecordDetailDto.getSongJson());
-		stuRecordDetailDto.setSingleSongRecordMinutes(Integer.parseInt(sysConfigDao.findConfigValue("single_song_record_minutes")));
+		stuRecordDetailDto.setSingleSongRecordMinutes(Integer.parseInt(sysConfigService.findConfigValue("single_song_record_minutes",studentExamResult.getTenantId())));
 		return stuRecordDetailDto;
 	}
 
@@ -644,7 +642,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 				throw new BizException("操作失败:没有待考学员");
 			}
 			//当等待人数到指定数值时,推送准备考试消息
-			int actionExamPush = Integer.parseInt(sysConfigDao.findConfigValue("action_exam_push"));
+			int actionExamPush = Integer.parseInt(sysConfigService.findConfigValue("action_exam_push",roomStudentListDto.getTenantId()));
 			if(actionExamPush != 0 && roomStudentListDtos.size() > actionExamPush){
 				RoomStudentListDto studentListDto = roomStudentListDtos.get(actionExamPush - 1);
 				if(studentListDto.getFinishedExam() == 3){

+ 3 - 2
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/PayServiceImpl.java

@@ -5,6 +5,7 @@ import com.keao.edu.thirdparty.adapay.Payment;
 import com.keao.edu.thirdparty.yqpay.YqPayUtil;
 import com.keao.edu.user.dao.SysConfigDao;
 import com.keao.edu.user.service.PayService;
+import com.keao.edu.user.service.SysConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -18,7 +19,7 @@ import java.util.*;
 public class PayServiceImpl implements PayService {
 
     @Autowired
-    private SysConfigDao sysConfigDao;
+    private SysConfigService sysConfigService;
 
     /**
      * 返回订单提交数据
@@ -40,7 +41,7 @@ public class PayServiceImpl implements PayService {
         Map<String, Object> payMap = null;
         String type = null;
         String routingMerNos = null;
-        String paymentChannel = sysConfigDao.findConfigValue("payment_channel");
+        String paymentChannel = sysConfigService.findConfigValue("payment_channel","0");
         if (paymentChannel.equals("YQPAY")) {
             payMap = YqPayUtil.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject, orderBody);
             type = "YQPAY";

+ 1 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ShortUrlServiceImpl.java

@@ -34,7 +34,7 @@ public class ShortUrlServiceImpl extends BaseServiceImpl<Long, ShortUrl> impleme
 		ShortUrl shortUrl=new ShortUrl(sourceUrl);
 		shortUrlDao.insert(shortUrl);
 
-		SysConfig baseUrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_API_URL);
+		SysConfig baseUrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_API_URL,"0");
 
 		StringBuffer returnUrl=new StringBuffer(baseUrlConfig.getParanValue());
 		returnUrl.append("/api-user/su/");

+ 21 - 2
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/SysConfigServiceImpl.java

@@ -6,6 +6,7 @@ import com.keao.edu.common.entity.SysConfig;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.user.dao.SysConfigDao;
 import com.keao.edu.user.service.SysConfigService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -21,7 +22,25 @@ public class SysConfigServiceImpl extends BaseServiceImpl<Long, SysConfig> imple
 	}
 
 	@Override
-	public SysConfig findByParamName(String paramName) {
-		return sysConfigDao.findByParamName(paramName);
+	public SysConfig findByParamName(String paramName,String tenantId) {
+		SysConfig sysConfig = sysConfigDao.getByParamName(paramName, tenantId);
+		if(sysConfig == null){
+			return sysConfigDao.getByParamName(paramName,"0");
+		}
+		return sysConfig;
+	}
+
+	@Override
+	public String findConfigValue(String paramName,String tenantId) {
+		String configValue = sysConfigDao.getConfigValue(paramName, tenantId);
+		if(StringUtils.isEmpty(configValue)){
+			return sysConfigDao.getConfigValue(paramName,"0");
+		}
+		return configValue;
+	}
+
+	@Override
+	public void initSysConfig(String tenantId) {
+		sysConfigDao.initSysConfig(tenantId);
 	}
 }

+ 5 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/TenantInfoServiceImpl.java

@@ -17,6 +17,7 @@ import com.keao.edu.user.dto.TenantInfoDto;
 import com.keao.edu.user.entity.Employee;
 import com.keao.edu.user.entity.Organization;
 import com.keao.edu.user.entity.TenantInfo;
+import com.keao.edu.user.service.SysConfigService;
 import com.keao.edu.user.service.TenantInfoService;
 import com.keao.edu.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -40,6 +41,8 @@ public class TenantInfoServiceImpl extends BaseServiceImpl<Integer, TenantInfo>
 	private ImFeignService imFeignService;
 	@Autowired
 	private EmployeeDao employeeDao;
+	@Autowired
+	private SysConfigService sysConfigService;
 
 	@Override
 	public BaseDAO<Integer, TenantInfo> getDAO() {
@@ -94,6 +97,8 @@ public class TenantInfoServiceImpl extends BaseServiceImpl<Integer, TenantInfo>
 		ImResult imResult = imFeignService.register(new ImUserModel(sysUser.getId().toString(), sysUser.getRealName(),null));
 		sysUser.setImToken(imResult.getToken());
 		sysUserDao.update(sysUser);
+		sysConfigService.initSysConfig(tenantInfo.getId().toString());
+
 	}
 
 	@Override

+ 2 - 1
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamCertificationMapper.xml

@@ -169,10 +169,11 @@
 		<result property="openFlag" column="open_flag_"/>
 		<result property="finishedExam" column="is_finished_exam_"/>
 		<result property="recordFlag" column="record_flag_"/>
+		<result property="tenantId" column="tenant_id_"/>
 	</resultMap>
 	<select id="needCheckingDetail" resultMap="NeedCheckingDetailDtoMap">
 		SELECT ersr.id_ exam_room_student_relation_id_,eb.name_ exam_base_name_,er.exam_start_time_,er.exam_end_time_,er.open_flag_,
-		ser.is_finished_exam_,ersr.exam_room_id_,ersr.sign_in_time_,ersr.classroom_switch_,ersr.exam_registration_id_,ser.record_flag_
+		ser.is_finished_exam_,ersr.exam_room_id_,ersr.sign_in_time_,ersr.classroom_switch_,ersr.exam_registration_id_,ser.record_flag_,ser.tenant_id_
 		FROM exam_room_student_relation ersr
 		LEFT JOIN examination_basic eb ON eb.id_ = ersr.examination_basic_id_
 		LEFT JOIN exam_room er ON er.id_ = ersr.exam_room_id_

+ 2 - 1
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -213,10 +213,11 @@
 		<result property="signInTime" column="sign_in_time_"/>
 		<result property="examRoomStudentRelationId" column="exam_room_student_relation_id_"/>
 		<result property="finishedExam" column="is_finished_exam_"/>
+		<result property="tenantId" column="tenant_id_"/>
 	</resultMap>
 	<select id="queryStudentList" resultMap="RoomStudentListDtoMap">
 		SELECT ersr.id_ exam_room_student_relation_id_,ersr.exam_registration_id_,su.real_name_,ersr.sign_in_time_,
-		s.name_ subject_name_,ec.level_,ersr.exam_room_id_,ersr.student_id_,ser.is_finished_exam_
+		s.name_ subject_name_,ec.level_,ersr.exam_room_id_,ersr.student_id_,ser.is_finished_exam_,ser.tenant_id_
 		FROM exam_room_student_relation ersr
 		LEFT JOIN exam_certification ec ON ec.exam_registration_id_ = ersr.exam_registration_id_
 		LEFT JOIN `subject` s ON s.id_ = ec.subject_id_

+ 24 - 15
edu-user/edu-user-biz/src/main/resources/config/mybatis/OrganizationMapper.xml

@@ -21,13 +21,15 @@
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
+		<result column="lock_flag_" property="lockFlag" />
+		<result column="subsidy_" property="subsidy" />
 		<association property="sysUser" resultMap="com.keao.edu.user.dao.SysUserDao.SysUser"/>
 	</resultMap>
 	<sql id="organizationColumn">
 		o.id_ organization_id_, o.user_id_, o.name_, o.contact_name_, o.contact_phone_,
 		o.settlement_type_, o.share_profit_amount_, o.level_, o.parent_organ_id_,
 		o.parent_organ_id_tag_, o.create_time_,
-		o.update_time_, o.del_flag_, o.tenant_id_
+		o.update_time_, o.del_flag_, o.tenant_id_,o.subsidy_
 	</sql>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -45,15 +47,20 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.entity.Organization" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO organization (id_,user_id_,name_,contact_name_,contact_phone_,level_,parent_organ_id_,parent_organ_id_tag_,settlement_type_,share_profit_amount_,create_time_,update_time_,tenant_id_)
-		VALUES(#{id},#{userId},#{name},#{contactName},#{contactPhone},#{level},#{parentOrganId},#{parentOrganIdTag},#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
-		#{shareProfitAmount},NOW(),NOW(),#{tenantId})
+		INSERT INTO organization (id_,user_id_,name_,contact_name_,contact_phone_,level_,parent_organ_id_,
+		parent_organ_id_tag_,settlement_type_,share_profit_amount_,create_time_,update_time_,tenant_id_,subsidy_)
+		VALUES(#{id},#{userId},#{name},#{contactName},#{contactPhone},#{level},#{parentOrganId},#{parentOrganIdTag},
+		#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+		#{shareProfitAmount},NOW(),NOW(),#{tenantId},#{subsidy})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.keao.edu.user.entity.Organization">
 		UPDATE organization
 		<set>
+			<if test="subsidy != null">
+				subsidy_ = #{subsidy},
+			</if>
 			<if test="contactPhone != null">
 				contact_phone_ = #{contactPhone},
 			</if>
@@ -98,40 +105,42 @@
 
 	<sql id="organQueryPage">
 		<where>
-			del_flag_ = 0
+			o.del_flag_ = 0
 			<if test="settlementType != null and settlementType != ''">
-				AND settlement_type_ = #{settlementType}
+				AND o.settlement_type_ = #{settlementType}
 			</if>
 			<if test="tenantId != null and tenantId != 0">
-				AND tenant_id_ = #{tenantId}
+				AND o.tenant_id_ = #{tenantId}
 			</if>
 			<if test="organId != null">
-				AND parent_organ_id_ = #{organId}
+				AND o.parent_organ_id_ = #{organId}
 			</if>
 			<if test="organIds != null">
-				AND id_ IN
+				AND o.id_ IN
 				<foreach collection="organIds" item="organId" separator="," open="(" close=")">
 					#{organId}
 				</foreach>
 			</if>
 			<if test="search != null and search != ''">
-				AND (id_ = #{search} OR name_ LIKE CONCAT('%',#{search},'%')
-				OR contact_name_ LIKE CONCAT('%',#{search},'%')
-				OR contact_phone_ LIKE CONCAT('%',#{search},'%'))
+				AND (o.id_ = #{search} OR name_ LIKE CONCAT('%',#{search},'%')
+				OR o.contact_name_ LIKE CONCAT('%',#{search},'%')
+				OR o.contact_phone_ LIKE CONCAT('%',#{search},'%'))
 			</if>
 		</where>
 	</sql>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="Organization" parameterType="map">
-		SELECT <include refid="organizationColumn"/> FROM organization o
+		SELECT <include refid="organizationColumn"/>,e.lock_flag_ FROM organization o
+		LEFT JOIN employee e ON o.user_id_ = e.user_id_
 		<include refid="organQueryPage"/>
-		ORDER BY update_time_ DESC <include refid="global.limit"/>
+		ORDER BY o.update_time_ DESC
+		<include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM organization
+		SELECT COUNT(o.id_) FROM organization o
 		<include refid="organQueryPage"/>
 	</select>
 

+ 17 - 8
edu-user/edu-user-biz/src/main/resources/config/mybatis/SysConfigMapper.xml

@@ -25,10 +25,10 @@
 		SELECT * FROM sys_config
 		<where>
 			<if test="group != null">
-				and group_ = #{group}
+				AND group_ = #{group}
 			</if>
 			<if test="tenantId != null">
-				and tenant_id_ = #{tenantId}
+				AND tenant_id_ = #{tenantId}
 			</if>
 		</where>
 		ORDER BY id_
@@ -43,6 +43,15 @@
 		(id_,param_name_,paran_value_,description_,create_on_,modify_on_,group_,tenant_id_,annotation_)
 		VALUES(#{id},#{paramName},#{paranValue},#{description},#{createOn},#{modifyOn},#{group},#{tenantId},#{annotation})
 	</insert>
+	<insert id="initSysConfig">
+		INSERT INTO `sys_config` (`param_name_`, `paran_value_`, `description_`, `annotation_`, `create_on_`, `modify_on_`, `group_`, `tenant_id_`)
+		VALUES ('exam_core_section', '[{\"excellent\":{\"startCore\":91,\"endCore\":100},\"good\":{\"startCore\":81,\"endCore\":90},\"general\":{\"startCore\":61,\"endCore\":80},\"flunk\":{\"startCore\":0,\"endCore\":60}}]',
+		'考试结果分数段设置', '考试结果分数段设置', NOW(), NOW(), 'default', #{tenantId});
+		INSERT INTO `sys_config` (`param_name_`, `paran_value_`, `description_`, `annotation_`, `create_on_`, `modify_on_`, `group_`, `tenant_id_`)
+		VALUES ('record_minutes', '15', '学员录播时长{}分钟', '学员录播时长', NOW(), NOW(), 'default', #{tenantId});
+		INSERT INTO `sys_config` (`param_name_`, `paran_value_`, `description_`, `annotation_`, `create_on_`, `modify_on_`, `group_`, `tenant_id_`) VALUES
+		 ('single_song_record_minutes', '5', '单首曲目录制{}分钟', '单首曲目录制时长',NOW(), NOW(), 'default', #{tenantId});
+	</insert>
 
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.keao.edu.common.entity.SysConfig">
@@ -66,7 +75,7 @@
 			<if test="group != null">
 				group_ = #{group},
 			</if>
-			<if test="tenantId != null and tenantId != 0">
+			<if test="tenantId != null">
 				tenant_id_ = #{tenantId},
 			</if>
 		</set>
@@ -80,7 +89,7 @@
 
 	<sql id="queryPageSql">
 		<where>
-			<if test="tenantId != null and tenantId != 0">
+			<if test="tenantId != null">
 				tenant_id_ = #{tenantId}
 			</if>
 		</where>
@@ -100,10 +109,10 @@
 		<include refid="queryPageSql"/>
 	</select>
 	
-	<select id="findByParamName" resultMap="SysConfig">
-		SELECT * FROM sys_config WHERE param_name_ = #{paramName}
+	<select id="getByParamName" resultMap="SysConfig">
+		SELECT * FROM sys_config WHERE param_name_ = #{paramName} AND tenant_id_ = #{tenantId} LIMIT 1
 	</select>
-    <select id="findConfigValue" resultType="java.lang.String">
-		SELECT paran_value_ FROM sys_config WHERE param_name_ = #{paramName}
+    <select id="getConfigValue" resultType="java.lang.String">
+		SELECT paran_value_ FROM sys_config WHERE param_name_ = #{paramName} AND tenant_id_ = #{tenantId} LIMIT 1
 	</select>
 </mapper>

+ 6 - 2
edu-user/edu-user-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -22,6 +22,7 @@
 		<result column="organ_id_" property="organId" />
 		<result column="city_" property="city" />
 		<result column="certificate_no_" property="certificateNo" />
+		<result column="subsidy_" property="subsidy" />
 		<association property="sysUser" columnPrefix="sys_user_" resultMap="com.keao.edu.user.dao.SysUserDao.SysUser"/>
 	</resultMap>
 
@@ -45,6 +46,9 @@
 	<update id="update" parameterType="com.keao.edu.user.entity.Teacher">
 		UPDATE teacher
 		<set>
+			<if test="subsidy != null">
+				subsidy_ = #{subsidy},
+			</if>
 			<if test="title != null">
 				title_ = #{title},
 			</if>
@@ -112,8 +116,8 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.entity.Teacher" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO teacher (user_id_,title_,subject_id_list_,salary_settlement_type_,salary_,create_time_,update_time_,tenant_id_,organ_id_,city_,certificate_no_)
-		VALUES(#{userId},#{title},#{subjectIdList},#{salarySettlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{salary},NOW(),NOW(),#{tenantId},#{organId},#{city},#{certificateNo})
+		INSERT INTO teacher (user_id_,title_,subject_id_list_,salary_settlement_type_,salary_,create_time_,update_time_,tenant_id_,organ_id_,city_,certificate_no_,subsidy_)
+		VALUES(#{userId},#{title},#{subjectIdList},#{salarySettlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{salary},NOW(),NOW(),#{tenantId},#{organId},#{city},#{certificateNo},#{subsidy})
 	</insert>
 
 	<update id="delete">

+ 7 - 4
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/SysConfigController.java

@@ -3,6 +3,7 @@ package com.keao.edu.user.controller;
 
 import com.keao.edu.common.controller.BaseController;
 import com.keao.edu.common.entity.SysConfig;
+import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.user.service.SysConfigService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -33,10 +34,10 @@ public class SysConfigController extends BaseController {
 	@GetMapping(value = "list")
     @PreAuthorize("@pcs.hasPermissions('sysConfig/list')")
 	public Object configList(String group) {
-//		String tenantId = TenantContextHolder.getTenantId();
+		String tenantId = TenantContextHolder.getTenantId();
 		Map<String,Object> params = new HashMap<String, Object>();
 		params.put("group", group);
-//		params.put("tenantId", tenantId);
+		params.put("tenantId", tenantId);
 		return succeed(sysConfigService.findAll(params));
 	}
 
@@ -82,12 +83,14 @@ public class SysConfigController extends BaseController {
 		if(StringUtils.isBlank(paramName)){
 			return failed("参数不能为空");
 		}
-		return succeed(sysConfigService.findByParamName(paramName));
+		String tenantId = TenantContextHolder.getTenantId();
+		return succeed(sysConfigService.findByParamName(paramName,tenantId));
 	}
 
 	@ApiOperation(value = "查询参数")
 	@PostMapping(value = "api/get")
 	public String apiGet(String paramName) {
-		return sysConfigService.findByParamName(paramName).getParanValue();
+		String tenantId = TenantContextHolder.getTenantId();
+		return sysConfigService.findByParamName(paramName,tenantId).getParanValue();
 	}
 }