Browse Source

Merge remote-tracking branch 'origin/dev' into qcloud

guq 6 years ago
parent
commit
5bb37376cc

+ 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);
 }

+ 1 - 0
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.*;

+ 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();

+ 3 - 3
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/support/RemindTask.java

@@ -1,6 +1,7 @@
 package com.usoftchina.smartschool.school.wxschool.support;
 
 import com.alibaba.fastjson.JSON;
+import com.usoftchina.smartschool.context.SpringContextHolder;
 import com.usoftchina.smartschool.school.po.MeetingDO;
 import com.usoftchina.smartschool.school.po.SchoolDO;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxMeetingMapper;
@@ -10,8 +11,8 @@ import com.usoftchina.smartschool.school.wxschool.mapper.WxTemplateMapper;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
 import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
 
+import javax.swing.*;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.List;
@@ -36,8 +37,7 @@ public class RemindTask extends TimerTask {
     private WxTemplateMapper wxTemplateMapper;
 
 
-    @Value("${smartschool.domain.wechat}")
-    private String wechatUrl;
+    private final static String wechatUrl = SpringContextHolder.getDomain();
 
     private MeetingDO meetingDO;
 

+ 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>

+ 1 - 1
frontend/wechat-web/src/modules/hiPages/meet-detail/MeetDetail.js

@@ -22,7 +22,7 @@ function SignItem(props) {
             || props.itemdata.teacherPhoto == undefined || props.itemdata.teacherPhoto == 'undefined' ? hi0_img : props.itemdata.teacherPhoto} alt="" style={{width:40,height:40,borderRadius:25}}/></div>
             {
                 props.itemdata.isRead == 3 ?
-                    <div  style={{fontSize:12,color:'#333333',marginTop:10}}> <span>{props.itemdata.teacherName}</span></div> :
+                    <div  style={{fontSize:12,color:'#999999',marginTop:10}}> <span>{props.itemdata.teacherName}</span></div> :
                     <div  style={{fontSize:12,color:'#000',marginTop:10}}> <span>{props.itemdata.teacherName}</span></div>
             }
         </div>

+ 4 - 10
frontend/wechat-web/src/modules/hiPages/res_apply/ResApply.js

@@ -228,16 +228,10 @@ class ResApply extends Component{
             return
         }
         var approveFiles = []
-        for(let i=0;i<this.state.fileList.length;i++){
-            if(this.state.fileList[i].response && this.state.fileList[i].response.success){
-                approveFiles.push(this.state.fileList[i].response.data)
-                if(i==this.state.fileList.length-1){
-                    this.setState({
-                        approveFiles:approveFiles
-                    })
-                    console.log('approveFiles',approveFiles)
-                }
-            }
+        if (this.state.fileList) {
+            this.state.fileList.forEach((value, index) => {
+                approveFiles.push(value.picUrl)
+            })
         }
         var params = {
             approveTitle: this.state.resUser,

+ 2 - 1
frontend/wechat-web/src/modules/homework/AssignmentDetailPage.js

@@ -106,6 +106,7 @@ class AssignmentDetailPage extends React.Component {
                 }
 
                 this.setState({
+                    teacherPhoto:response.data.teacherPhoto,
                     teachName: response.data.teacherName,
                     endTime: response.data.endDate,
                     headerUrl: response.data.teacherPhoto,
@@ -198,7 +199,7 @@ class AssignmentDetailPage extends React.Component {
                     {isObjEmpty(userInfo.userAvatar) ?
                         <Avatar size={55} icon='user'/> :
                         <img className="img-circle"
-                             src={userInfo.userAvatar}
+                             src={this.state.teacherPhoto}
                              width={55} height={55}/>
                     }
                     <div className='common-flex-column-y-center' style={{paddingLeft: '14px'}}>