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

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

guq 6 жил өмнө
parent
commit
d5afee6b3f

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

@@ -160,6 +160,11 @@ public class TeacherServiceImpl implements TeacherService{
                         Long userId = createAccount(teacher);
                         Long userId = createAccount(teacher);
                         teacher.setUser_id(userId);
                         teacher.setUser_id(userId);
                     }
                     }
+                    Integer count;
+                    count = sysTeacherMapper.count(teacher.getTeacher_number(),schoolId);
+                    if(count > 0){
+                        throw new BizException(BizExceptionCode.REPEAT_TEACHER_NUMBER);
+                    }
                     sysTeacherMapper.insertSelective(teacher);
                     sysTeacherMapper.insertSelective(teacher);
                     teachers.add(teacher);
                     teachers.add(teacher);
                     //年纪存在、需要更新
                     //年纪存在、需要更新

+ 16 - 1
frontend/wechat-web/src/components/UploadEnclosure.jsx

@@ -10,12 +10,14 @@ import {isObjEmpty, isObjNull} from "../utils/common";
 import ImagesViewer from '../components/imagesVIewer/index'
 import ImagesViewer from '../components/imagesVIewer/index'
 import PropTypes from 'prop-types';
 import PropTypes from 'prop-types';
 import 'css/upload.css'
 import 'css/upload.css'
+import {_baseURL} from "../configs/api.config";
 
 
 let uploadFail = false;
 let uploadFail = false;
 export default class UploadEnclosure extends Component {
 export default class UploadEnclosure extends Component {
 
 
     static propTypes = {
     static propTypes = {
         action: PropTypes.string.isRequired,//上传地址
         action: PropTypes.string.isRequired,//上传地址
+        data: PropTypes.object,//上传所需参数
         accept: PropTypes.string,//接受上传的文件类型
         accept: PropTypes.string,//接受上传的文件类型
         listType: PropTypes.string,//附件列表格式,默认picture-card
         listType: PropTypes.string,//附件列表格式,默认picture-card
         count: PropTypes.number,//附件限制数量,默认为1
         count: PropTypes.number,//附件限制数量,默认为1
@@ -32,6 +34,9 @@ export default class UploadEnclosure extends Component {
     static defaultProps = {
     static defaultProps = {
         listType: 'picture-card',
         listType: 'picture-card',
         count: 1,
         count: 1,
+        data: {
+            folderId: 0
+        },
         multiple: false,
         multiple: false,
         title: '附件',
         title: '附件',
         needPoint: true,
         needPoint: true,
@@ -65,7 +70,7 @@ export default class UploadEnclosure extends Component {
         const {fileList} = this.state
         const {fileList} = this.state
         const {
         const {
             action, listType, count, multiple,
             action, listType, count, multiple,
-            title, needPoint, limit, accept
+            title, needPoint, limit, accept, data
         } = this.props
         } = this.props
 
 
         const imgs = []
         const imgs = []
@@ -97,6 +102,7 @@ export default class UploadEnclosure extends Component {
                     <Upload
                     <Upload
                         action={action}
                         action={action}
                         accept={accept}
                         accept={accept}
+                        data={data}
                         listType={listType}
                         listType={listType}
                         fileList={fileList}
                         fileList={fileList}
                         multiple={multiple}
                         multiple={multiple}
@@ -142,10 +148,19 @@ export default class UploadEnclosure extends Component {
     }
     }
 
 
     handleChange = ({fileList}) => {
     handleChange = ({fileList}) => {
+        console.log('filelist', fileList)
         if (uploadFail) {
         if (uploadFail) {
             return
             return
         }
         }
         if (fileList.length <= this.props.count || !this.props.limit) {
         if (fileList.length <= this.props.count || !this.props.limit) {
+            if (fileList) {
+                fileList.forEach((value, index) => {
+                    value.url = (value.response && value.response.data) ? value.response.data.accessPath : value.url
+                    value.picUrl = value.url
+                    value.relativeUrl = (value.response && value.response.data) ? value.response.data.fullPath : value.relativeUrl
+                })
+            }
+
             this.setState({fileList})
             this.setState({fileList})
             this.props.handleChange(fileList)
             this.props.handleChange(fileList)
         }
         }

+ 0 - 5
frontend/wechat-web/src/modules/album/UploadImage.jsx

@@ -135,11 +135,6 @@ export default class UploadImage extends Component {
 
 
     handleChange = fileList => {
     handleChange = fileList => {
         if (fileList) {
         if (fileList) {
-            fileList.forEach((value, index) => {
-                value.url = value.response ? (_baseURL + value.response.data) : value.url
-                value.picUrl = value.response ? value.response.data : value.picUrl
-            })
-
             this.setState({fileList})
             this.setState({fileList})
         }
         }
     }
     }

+ 0 - 5
frontend/wechat-web/src/modules/announce/AnnounceRelease.jsx

@@ -291,11 +291,6 @@ class AnnounceRelease extends Component {
 
 
     handleChange = fileList => {
     handleChange = fileList => {
         if (fileList) {
         if (fileList) {
-            fileList.forEach((value, index) => {
-                value.url = value.response ? (_baseURL + value.response.data) : value.url
-                value.picUrl = value.response ? value.response.data : value.picUrl
-            })
-
             this.setState({fileList})
             this.setState({fileList})
         }
         }
     }
     }

+ 0 - 5
frontend/wechat-web/src/modules/hiPages/field-trip/FieldTrip.js

@@ -398,11 +398,6 @@ class FieldTrip extends Component {
     }
     }
     handleChange = fileList => {
     handleChange = fileList => {
         if (fileList) {
         if (fileList) {
-            fileList.forEach((value, index) => {
-                value.url = value.response ? (_baseURL + value.response.data) : value.url
-                value.picUrl = value.response ? value.response.data : value.picUrl
-            })
-
             this.setState({fileList})
             this.setState({fileList})
         }
         }
     }
     }

+ 0 - 5
frontend/wechat-web/src/modules/hiPages/res_apply/ResApply.js

@@ -124,11 +124,6 @@ class ResApply extends Component{
     }
     }
     handleChange = fileList => {
     handleChange = fileList => {
         if (fileList) {
         if (fileList) {
-            fileList.forEach((value, index) => {
-                value.url = value.response ? (_baseURL + value.response.data) : value.url
-                value.picUrl = value.response ? value.response.data : value.picUrl
-            })
-
             this.setState({fileList})
             this.setState({fileList})
         }
         }
     }
     }

+ 0 - 5
frontend/wechat-web/src/modules/hiPages/send-vote/SendVote.js

@@ -436,11 +436,6 @@ class SendVote extends Component {
     }
     }
     handleChange = fileList => {
     handleChange = fileList => {
         if (fileList) {
         if (fileList) {
-            fileList.forEach((value, index) => {
-                value.url = value.response ? (_baseURL + value.response.data) : value.url
-                value.picUrl = value.response ? value.response.data : value.picUrl
-            })
-
             this.setState({fileList})
             this.setState({fileList})
         }
         }
     }
     }

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

@@ -84,7 +84,7 @@ class AssignmentDetailPage extends React.Component {
                 if (response.data.taskFiles) {
                 if (response.data.taskFiles) {
                     let temps = JSON.parse(response.data.taskFiles);
                     let temps = JSON.parse(response.data.taskFiles);
                     for (let i = 0; i < temps.length; i++) {
                     for (let i = 0; i < temps.length; i++) {
-                        images.push(_baseURL + temps[i]);
+                        images.push(temps[i]);
                     }
                     }
                 }
                 }
                 if (response.data.taskContext) {
                 if (response.data.taskContext) {

+ 0 - 5
frontend/wechat-web/src/modules/homework/ReleaseAssignmentPage.js

@@ -52,11 +52,6 @@ class ReleaseAssignmentPage extends React.Component {
 
 
     handleChange = (fileList) => {
     handleChange = (fileList) => {
         if (fileList) {
         if (fileList) {
-            fileList.forEach((value, index) => {
-                value.url = value.response ? (_baseURL + value.response.data) : value.url
-                value.picUrl = value.response ? value.response.data : value.picUrl
-            })
-
             this.setState({fileList})
             this.setState({fileList})
         }
         }
 
 

+ 0 - 4
frontend/wechat-web/src/modules/leave/LeaveAddCPage.js

@@ -293,10 +293,6 @@ class LeaveAddCPage extends Component {
     }
     }
     handleChange = fileList => {
     handleChange = fileList => {
         if (fileList) {
         if (fileList) {
-            fileList.forEach((value, index) => {
-                value.url = value.response ? (_baseURL + value.response.data) : value.url
-                value.picUrl = value.response ? value.response.data : value.picUrl
-            })
             this.setState({fileList})
             this.setState({fileList})
         }
         }
     }
     }

+ 0 - 4
frontend/wechat-web/src/modules/leave/LeaveAddPage.js

@@ -255,10 +255,6 @@ class LeaveAddPage extends Component{
     }
     }
     handleChange = fileList => {
     handleChange = fileList => {
         if (fileList) {
         if (fileList) {
-            fileList.forEach((value, index) => {
-                value.url = value.response ? (_baseURL + value.response.data) : value.url
-                value.picUrl = value.response ? value.response.data : value.picUrl
-            })
             this.setState({fileList})
             this.setState({fileList})
         }
         }
     }
     }

+ 0 - 5
frontend/wechat-web/src/modules/principalMailbox/PrincipalMailbox.jsx

@@ -142,11 +142,6 @@ class PrincipalMailbox extends Component {
 
 
     handleChange = fileList => {
     handleChange = fileList => {
         if (fileList) {
         if (fileList) {
-            fileList.forEach((value, index) => {
-                value.url = value.response ? (_baseURL + value.response.data) : value.url
-                value.picUrl = value.response ? value.response.data : value.picUrl
-            })
-
             this.setState({fileList})
             this.setState({fileList})
         }
         }
     }
     }

+ 0 - 5
frontend/wechat-web/src/modules/user/UserInfo.js

@@ -210,11 +210,6 @@ class UserInfo extends Component {
 
 
     handleChange = fileList => {
     handleChange = fileList => {
         if (fileList) {
         if (fileList) {
-            fileList.forEach((value, index) => {
-                value.url = value.response ? (_baseURL + value.response.data) : value.url
-                value.picUrl = value.response ? value.response.data : value.picUrl
-            })
-
             this.setState({fileList})
             this.setState({fileList})
 
 
             if (fileList[0].status === 'error') {
             if (fileList[0].status === 'error') {