Browse Source

Merge branches 'dev' and 'master' of ssh://10.10.100.21/source/smartschool-platform into dev

FANGLH 6 years ago
parent
commit
0110d5855e

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

@@ -4,20 +4,21 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.usoftchina.smartschool.school.po.MeetingDO;
 import com.usoftchina.smartschool.school.po.MeetingRecordsDO;
+import com.usoftchina.smartschool.school.po.SchoolDO;
 import com.usoftchina.smartschool.school.po.TeacherDO;
+import com.usoftchina.smartschool.school.wxschool.basic.service.WxMeetingService;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxMeetingMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxMeetingRecordsMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxSchoolMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxTeacherMapper;
-import com.usoftchina.smartschool.school.wxschool.basic.service.WxMeetingService;
 import com.usoftchina.smartschool.school.wxschool.support.RemindTask;
 import com.usoftchina.smartschool.school.wxschool.utils.DateFormatUtil;
 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.stereotype.Service;
 
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 
@@ -83,7 +84,16 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 			Timer timer = new Timer();
 			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushApi,meetingMapper,1,meetingDO), startDate);
 			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushApi,meetingMapper,2,meetingDO), endDate);
-			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushApi,meetingMapper,3,meetingDO), reminderDate);
+			if (new Date().getTime()<reminderDate.getTime()) {
+				timer.schedule(new RemindTask(teacherMapper, wxSchoolMapper, wxPushApi, meetingMapper, 3, meetingDO), reminderDate);
+			}else {
+				for (Long l:list) {
+					SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+					SchoolDO schoolDO = wxSchoolMapper.get(meetingDO.getSchoolId());
+					String openid = teacherMapper.get(l).getOpenid();
+					wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , "_hX_lGEG1W1bJmW37VBaPYQoLrRrUAlNCSScezZQQWk", "您好,您有一条新的会议通知", meetingDO.getMeetingName(), simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情", "https://school-wechat.ubtob.com/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+l);
+				}
+			}
 			return "创建成功";
 		}else {
 			throw new Exception("创建失败,请核查");

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

@@ -74,11 +74,7 @@ public class WxOaLeaveServiceImpl implements WxOaLeaveService {
                     SchoolDO schoolDO = wxSchoolMapper.get(teacherDO.getSchoolId());
                     String stuName = studentMapper.get(lvProposer).getStuName();
                     try {
-                        wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(),
-                                "QC8H4hQd1Fh0wqaaE3mbAxvoBC6y-XkHctIe8Kx6gcA", "您好,您有一个来自家长的请假申请",
-                                stuName,
-                                startDate + "-" + endDate, lvDetails, "-",
-                                "点击查看详情", "https://school-wechat.ubtob.com/leavedetail/teacher/" + leave.getLvId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(), "QC8H4hQd1Fh0wqaaE3mbAxvoBC6y-XkHctIe8Kx6gcA", "您好,您有一个来自家长的请假申请",stuName,startDate + "-" + endDate, lvDetails, "", "点击查看详情", "https://school-wechat.ubtob.com/leavedetail/teacher/" + leave.getLvId());
                     }catch (Exception e){
                         e.printStackTrace();
                     }
@@ -150,6 +146,8 @@ public class WxOaLeaveServiceImpl implements WxOaLeaveService {
     public OaLeaveDO lvDetail(Long lvId) throws Exception {
         OaLeaveDO oaLeaveDO = oaLeaveMapper.get(lvId);
         if (ObjectUtils.isNotEmpty(oaLeaveDO)) {
+            oaLeaveDO.setLvStatus(2);
+            oaLeaveMapper.update(oaLeaveDO);
             return getOaLeaveDetail(oaLeaveDO);
         } else {
             throw new Exception("暂无数据");

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

@@ -58,7 +58,7 @@ public class RemindTask extends TimerTask {
             SchoolDO schoolDO = wxSchoolMapper.get(meetingDO.getSchoolId());
             String openid = teacherMapper.get(teacherId).getOpenid();
             try {
-                wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , "_hX_lGEG1W1bJmW37VBaPYQoLrRrUAlNCSScezZQQWk", "您好,您有一条新的会议通知", meetingDO.getMeetingName(), simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情", "https://school-wechat.ubtob.com/meet-detail/" +teacherId+"/"+ meetingDO.getMeetingId()+"?teacherId="+teacherId);
+                wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , "_hX_lGEG1W1bJmW37VBaPYQoLrRrUAlNCSScezZQQWk", "您好,您有一条新的会议通知", meetingDO.getMeetingName(), simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情", "https://school-wechat.ubtob.com/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+teacherId);
             } catch (Exception e) {
                 e.printStackTrace();
             }

+ 1 - 0
frontend/wechat-web/src/components/TargetSelect.jsx

@@ -69,6 +69,7 @@ export default class TargetSelect extends Component {
             treeCheckable: multiple,
             showCheckedStrategy: SHOW_PARENT,
             searchPlaceholder: `请选择${title}`,
+            showSearch: true,
             style: {
                 width: '100%',
             },

+ 19 - 1
frontend/wechat-web/src/modules/phonesBook/PhonesSelect.jsx

@@ -17,6 +17,7 @@ import {Toast} from "antd-mobile";
 import RefreshLayout from "../../components/RefreshLayout";
 import {getStrValue} from "../../utils/common";
 import {connect} from 'react-redux'
+import {saveListState} from "../../redux/actions/listState";
 
 let mySwiper
 
@@ -61,6 +62,14 @@ class PhonesSelect extends Component {
             }
         })
 
+        if (this.props.listState.tabIndex >= 0) {
+            this.setState({
+                selectIndex: this.props.listState.tabIndex
+            }, () => {
+                mySwiper.slideTo(this.state.selectIndex, 0, false)
+            })
+        }
+
         mPageIndex = 0
         this.getTeacherPhones()
         this.getClassList()
@@ -276,6 +285,10 @@ class PhonesSelect extends Component {
             selectIndex: 0
         }, () => {
             mySwiper.slideTo(this.state.selectIndex, 300, false)
+
+            saveListState({
+                tabIndex: this.state.selectIndex,
+            })()
         })
     }
 
@@ -284,12 +297,17 @@ class PhonesSelect extends Component {
             selectIndex: 1
         }, () => {
             mySwiper.slideTo(this.state.selectIndex, 300, false)
+
+            saveListState({
+                tabIndex: this.state.selectIndex,
+            })()
         })
     }
 }
 
 let mapStateToProps = (state) => ({
-    userInfo: {...state.redUserInfo}
+    userInfo: {...state.redUserInfo},
+    listState: {...state.redListState}
 })
 
 let mapDispatchToProps = (dispatch) => ({})

+ 22 - 4
frontend/wechat-web/src/utils/common.js

@@ -316,13 +316,13 @@ export function getDirFiles(directory, useSubdirectories, regExp) {
 
 export const getCheckedNodes = (extra) => {
     let checkedNodes = extra.allCheckedNodes || [extra.triggerNode]
-    let count = getCheckedCount(checkedNodes)
+    // let count = getCheckedCount(checkedNodes)
     if (isObjEmpty(checkedNodes)) {
         checkedNodes = []
     }
     checkedNodes = getNodes(checkedNodes)
     console.log('checkNodes', checkedNodes)
-    return {checkedNodes, count}
+    return {checkedNodes, count: checkedNodes.length}
 }
 
 export const getCheckedCount = (checkedNodes) => {
@@ -372,7 +372,16 @@ export const getNodes = (checkedNodes) => {
                         checkedNode = checkProps.children
                         childNodes = childNodes.concat(getNodes(checkedNode))
                     } else {
-                        childNodes.push(checkProps)
+                        let exist = false
+                        for (let j = 0; j < childNodes.length; j++) {
+                            if (checkProps && checkProps.value == childNodes[j].value) {
+                                exist = true
+                                break
+                            }
+                        }
+                        if (!exist) {
+                            childNodes.push(checkProps)
+                        }
                         continue
                     }
                 } else {
@@ -382,7 +391,16 @@ export const getNodes = (checkedNodes) => {
                             checkedNode = checkProps.children
                             childNodes = childNodes.concat(getNodes(checkedNode))
                         } else {
-                            childNodes.push(checkProps)
+                            let exist = false
+                            for (let j = 0; j < childNodes.length; j++) {
+                                if (checkProps && checkProps.value == childNodes[j].value) {
+                                    exist = true
+                                    break
+                                }
+                            }
+                            if (!exist) {
+                                childNodes.push(checkProps)
+                            }
                             continue
                         }
                     }