Эх сурвалжийг харах

Merge branch 'dev' of ssh://10.10.100.21/source/smartschool-platform into dev

FANGLH 6 жил өмнө
parent
commit
183fc4bfd9

+ 5 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/CurriculumServiceImpl.java

@@ -160,6 +160,11 @@ public class CurriculumServiceImpl implements CurriculumService {
             }
         }else {
             //更新主表
+            //如果班级发生变更
+            String oldClazzId = curriculumMapper.selectMain(main.getId()).getClazzId();
+            if (!main.getClazzId().equals(oldClazzId)){
+                curriculumMapper.updateDetailClazzIdByMainId(Long.parseLong(main.getClazzId()), main.getId());
+            }
             curriculumMapper.updateByPrimaryKeySelective(main);
             if (!CollectionUtils.isEmpty(items)) {
                 List<CurriculumDetailDTO> insertList = new ArrayList<CurriculumDetailDTO>();

+ 7 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/CurriculumMapper.java

@@ -120,4 +120,11 @@ public interface CurriculumMapper {
      * @return
      */
     int updateByRepublish(Long id);
+
+    /**
+     * 课表班级发生变更时,更新明细表对应的班级
+     * @param clazzId
+     * @param mainId
+     */
+    void updateDetailClazzIdByMainId(@Param("clazzId") Long clazzId, @Param("mainId") Long mainId);
 }

+ 2 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxMeetingServiceImpl.java

@@ -2,6 +2,7 @@ package com.usoftchina.smartschool.school.wxschool.basic.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.usoftchina.smartschool.context.SpringContextHolder;
 import com.usoftchina.smartschool.school.po.*;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxMeetingService;
 import com.usoftchina.smartschool.school.wxschool.mapper.*;
@@ -37,8 +38,7 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 	@Autowired
 	private WxTemplateMapper wxTemplateMapper;
 
-	@Value("${smartschool.domain.wechat}")
-	private String wechatUrl;
+	private final static String wechatUrl = SpringContextHolder.getDomain();
 
 	/**
 	 * 创建会议

+ 5 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxNotifyServiceImpl.java

@@ -8,6 +8,8 @@ import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
 import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.apache.commons.collections.CollectionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -50,6 +52,8 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 	private String wechatUrl;
 
 
+	private final static Logger LOGGER = LoggerFactory.getLogger(WxNotifyServiceImpl.class);
+
 	/**
 	 * 获取系统消息和使用帮助
 	 * @param notifyType
@@ -115,6 +119,7 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 									String schoolName = schoolDO.getSchoolName();
 									String teacherName = teacherMapper.get(notifyCreator).getTeacherName();
 									try {
+										LOGGER.error("URL:{}" , wechatUrl);
 										wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), school, "您好,您有一条通知",schoolName ,teacherName,format.format(new Date()),notifyDetails, "点击查看详情", wechatUrl + "/notifyDetail/teacher/"+notifyDO.getNotifyId()+"?teacherId="+l);
 									}catch (Exception e){
 										e.printStackTrace();

+ 4 - 0
applications/school/school-server/src/main/resources/mapper/CurriculumMapper.xml

@@ -290,4 +290,8 @@
     where id = #{id,jdbcType=BIGINT}
   </update>
 
+  <update id="updateDetailClazzIdByMainId" >
+    update clazz_curriculum set clazz_id = #{clazzId} where cur_mid = #{mainId}
+  </update>
+
 </mapper>