Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dd_school
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqi
dd_school
Commits
7032986b
Commit
7032986b
authored
Oct 27, 2023
by
Cat
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://49.232.152.146:6688/qangqi/dd_school
parents
3bd9dcce
4a312190
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
1812 additions
and
144 deletions
+1812
-144
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
+1
-0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
+6
-0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
+6
-0
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
+5
-0
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
+2
-0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
+25
-0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
+10
-0
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
+26
-1
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
+26
-0
ruoyi-ui/src/views/smartSchool/InstrumentDrugAdministration/index.vue
+484
-0
ruoyi-ui/src/views/smartSchool/InstrumentDrugAdministration/instrumentManagement/index.vue
+16
-12
ruoyi-ui/src/views/smartSchool/laboratoryManagement/laboratoryManagements/laboratoryCompetition/index copy.vue
+481
-0
ruoyi-ui/src/views/smartSchool/laboratoryManagement/laboratoryManagements/laboratoryCompetition/index.vue
+17
-8
smart-campus/src/main/java/yangtz/cs/liu/campus/controller/teacherFiles/TeacherFilesController.java
+15
-3
smart-campus/src/main/java/yangtz/cs/liu/campus/domain/teacherFiles/TeacherFilesNotice.java
+10
-1
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/schoolClass/SchoolClassMapper.java
+2
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/schoolCurriculum/SchoolCurriculumMapper.java
+4
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/schoolgrade/SchoolGradeMapper.java
+8
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/teacher/SchoolTeacherMapper.java
+2
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/teacherFiles/TeacherFilesNoticeMapper.java
+5
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolLab/SchoolLabClassYearServiceImpl.java
+7
-1
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolgrade/ISchoolGradeImpl.java
+12
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/teacherFiles/TeacherFilesNoticeServiceImpl.java
+176
-77
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/teacherFiles/TeacherFilesServiceImpl.java
+6
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/service/schoolgrade/ISchoolGradeService.java
+3
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/service/student/ISchoolStudentService.java
+3
-3
smart-campus/src/main/java/yangtz/cs/liu/campus/service/teacherFiles/ITeacherFilesService.java
+2
-0
smart-campus/src/main/java/yangtz/cs/liu/dingding/controller/DingJiaXiaoController.java
+28
-25
smart-campus/src/main/java/yangtz/cs/liu/dingding/controller/dingEvent/DingEventController.java
+34
-1
smart-campus/src/main/java/yangtz/cs/liu/dingding/service/impl/dingUser/DdUserServiceImpl.java
+230
-0
smart-campus/src/main/java/yangtz/cs/liu/wechat/controller/experiment/ExperimentLevelController.java
+29
-4
smart-campus/src/main/java/yangtz/cs/liu/wechat/controller/leave/WxTeacherLeaveController.java
+111
-7
smart-campus/src/main/resources/mapper/schoolClass/SchoolClassMapper.xml
+6
-1
smart-campus/src/main/resources/mapper/schoolgrade/SchoolGradeMapper.xml
+8
-0
smart-campus/src/main/resources/mapper/teacher/SchoolTeacherMapper.xml
+6
-0
No files found.
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
View file @
7032986b
...
...
@@ -106,6 +106,7 @@ public class SysUser extends BaseEntity
private
SysDept
dept
;
/** 角色对象 */
@Excel
(
name
=
"角色"
)
private
List
<
SysRole
>
roles
;
/** 角色组 */
...
...
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
View file @
7032986b
package
com
.
ruoyi
.
system
.
mapper
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Param
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
...
...
@@ -18,6 +20,10 @@ public interface SysDeptMapper
* @return 部门信息集合
*/
public
List
<
SysDept
>
selectDeptList
(
SysDept
dept
);
public
List
<
Map
<
String
,
Object
>>
selectDeptGroupByUserId
(
Long
userId
);
public
List
<
SysDept
>
selectDepartmentDept
(
String
deptName
);
public
SysDept
selectParenById
(
@Param
(
"deptId"
)
Long
deptId
,
@Param
(
"parenId"
)
Long
parenId
);
public
String
selectSupDeptName
(
Long
deptId
);
/**
* 根据角色ID查询部门树信息
...
...
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
View file @
7032986b
...
...
@@ -21,6 +21,7 @@ public interface SysUserMapper {
public
List
<
SysUser
>
selectUserList
(
SysUser
sysUser
);
public
List
<
SysUser
>
selectUserListTypeLogin
(
SysUser
sysUser
);
public
List
<
SysUser
>
selectDeptAncetorsByPernId
(
String
deptId
);
/**
* 根据条件分页查询已配用户角色列表
...
...
@@ -30,6 +31,11 @@ public interface SysUserMapper {
*/
public
List
<
SysUser
>
selectAllocatedList
(
SysUser
user
);
public
List
<
String
>
selectDeptRoleBydeptId
(
String
deptId
);
public
List
<
String
>
selectDeptPlaceBydeptId
(
String
deptId
);
/**
* 根据条件分页查询未分配用户角色列表
*
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
View file @
7032986b
package
com
.
ruoyi
.
system
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
com.ruoyi.common.core.domain.TreeSelect
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
...
...
@@ -18,6 +20,9 @@ public interface ISysDeptService
* @return 部门信息集合
*/
public
List
<
SysDept
>
selectDeptList
(
SysDept
dept
);
public
List
<
SysDept
>
selectDept
(
SysDept
dept
);
public
List
<
Map
<
String
,
Object
>>
selectDeptGroupByUserId
(
Long
userId
);
public
SysDept
selectParenById
(
Long
depeId
,
Long
parenId
);
/**
* 查询部门树结构信息
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
View file @
7032986b
...
...
@@ -26,6 +26,8 @@ public interface ISysUserService {
* @return 用户信息集合信息
*/
public
List
<
SysUser
>
selectAllocatedList
(
SysUser
user
);
public
List
<
String
>
selectDeptRoleBydeptId
(
String
deptId
);
public
List
<
String
>
selectDeptPlaceBydeptId
(
String
deptId
);
/**
* 根据条件分页查询未分配用户角色列表
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
View file @
7032986b
...
...
@@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -46,6 +47,30 @@ public class SysDeptServiceImpl implements ISysDeptService
public
List
<
SysDept
>
selectDeptList
(
SysDept
dept
)
{
return
deptMapper
.
selectDeptList
(
dept
);
}
@Override
public
List
<
SysDept
>
selectDept
(
SysDept
dept
)
{
return
deptMapper
.
selectDeptList
(
dept
);
}
/**
* 根据用户查找所在的部门
* @param userId
* @return
*/
@Override
public
List
<
Map
<
String
,
Object
>>
selectDeptGroupByUserId
(
Long
userId
)
{
return
deptMapper
.
selectDeptGroupByUserId
(
userId
);
}
@Override
public
SysDept
selectParenById
(
Long
deptId
,
Long
parenId
)
{
return
deptMapper
.
selectParenById
(
deptId
,
parenId
);
}
/**
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
View file @
7032986b
...
...
@@ -93,6 +93,16 @@ public class SysUserServiceImpl implements ISysUserService {
return
userMapper
.
selectAllocatedList
(
user
);
}
@Override
public
List
<
String
>
selectDeptRoleBydeptId
(
String
deptId
)
{
return
userMapper
.
selectDeptRoleBydeptId
(
deptId
)
;
}
@Override
public
List
<
String
>
selectDeptPlaceBydeptId
(
String
deptId
)
{
return
userMapper
.
selectDeptPlaceBydeptId
(
deptId
)
;
}
/**
* 根据条件分页查询未分配用户角色列表
*
...
...
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
View file @
7032986b
...
...
@@ -47,7 +47,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by d.parent_id, d.order_num
</select>
<select
id=
"selectDeptListByRoleId"
resultType=
"Long"
>
<select
id=
"selectDeptGroupByUserId"
parameterType=
"Long"
resultType=
"Map"
>
SELECT d.dept_id as deptId,d.dept_name AS deptName,d.parent_id as parentId FROM sys_user u
LEFT JOIN sys_dd_user_dept ud on u.user_id = ud.user_id LEFT JOIN sys_dept d on ud.dept_id = d.dept_id
WHERE u.user_id = #{dept} AND d.del_flag = 0
</select>
<select
id=
"selectParenById"
resultMap=
"SysDeptResult"
>
<include
refid=
"selectDeptVo"
/>
where dept_id=#{deptId} and parent_id = #{parenId} and del_flag = '0'
</select>
<select
id=
"selectSupDeptName"
resultType=
"String"
>
select d.ancestors FROM sys_dept d WHERE d.dept_id = #{deptId}
</select>
<select
id=
"selectDepartmentDept"
resultMap=
"SysDeptResult"
>
<include
refid=
"selectDeptVo"
/>
where dept_name like concat('%', #{deptName}, '%') and del_flag = '0'
</select>
<select
id=
"selectDeptListByRoleId"
resultType=
"Long"
>
select d.dept_id
from sys_dept d
left join sys_role_dept rd on d.dept_id = rd.dept_id
...
...
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
View file @
7032986b
...
...
@@ -167,6 +167,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where u.user_name = #{userName} and u.del_flag = '0'
</select>
<select
id=
"selectDeptAncetorsByPernId"
parameterType=
"String"
resultMap=
"SysUserResult"
>
SELECT u. *,d.* FROM sys_user u LEFT JOIN sys_user_dept ud on u.user_id = ud.user_id LEFT JOIN sys_dept d on ud.dept_id = d.dept_id
where d.ancestors like concat('%', #{deptId}, '%') GROUP BY u.user_id
</select>
<select
id=
"selectDeptRoleBydeptId"
parameterType=
"String"
resultType=
"String"
>
SELECT su.login_name name FROM sys_user su LEFT JOIN sys_user_dept u on su.user_id = u.user_id LEFT JOIN sys_dept d on d.dept_id = u.dept_id
LEFT JOIN sys_user_role ur on u.user_id = ur.user_id LEFT JOIN sys_role r
on r.role_id = ur.role_id WHERE r.role_name="级部主任" and d.ancestors like concat('%', #{deptId}, '%') GROUP BY su.user_id
</select>
<select
id=
"selectDeptPlaceBydeptId"
parameterType=
"String"
resultType=
"String"
>
SELECT u.user_name FROM sys_user u LEFT JOIN sys_user_dept ud on u.user_id = ud.user_id LEFT JOIN sys_dept d on d.dept_id = ud.dept_id
LEFT JOIN sys_user_role ur on ur.user_id = u.user_id LEFT JOIN sys_role r on r.role_id = ur.role_id
WHERE r.role_key ="sectionLeader"
AND d.ancestors LIKE concat('%', #{deptId}, '%') GROUP BY u.user_name
</select>
<select
id=
"selectUserById"
parameterType=
"Long"
resultMap=
"SysUserResult"
>
<include
refid=
"selectUserVo"
/>
where u.user_id = #{userId}
...
...
ruoyi-ui/src/views/smartSchool/InstrumentDrugAdministration/index.vue
0 → 100644
View file @
7032986b
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryForm"
ref=
"queryForm"
size=
"small"
:inline=
"true"
>
<el-form-item
label=
"仪器名称"
>
<el-input
v-model=
"queryForm.instrumentName"
style=
"width: 100%"
placeholder=
"请输入"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"仪器分类"
>
<treeselect
v-model=
"queryForm.instrumentTypeId"
:options=
"equiList"
:normalizer=
"normalizer"
placeholder=
"选择分类编码"
clearable
style=
"width: 192px"
noOptionsText=
"暂无数据"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"getList"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<!-- 操作按钮 -->
<el-row
class=
"mb8"
:gutter=
"8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleOption(0)"
>
新增
</el-button>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
@
click=
"handleDelete()"
>
批量删除
</el-button>
</el-col>
</el-row>
<!-- 表格 -->
<el-table
stripe
:data=
"tableData"
border
style=
"width: 98%"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
align=
"center"
type=
"index"
label=
"序号"
width=
"55"
/>
<el-table-column
align=
"center"
prop=
"instrumentName"
label=
"仪器名称"
/>
<el-table-column
align=
"center"
prop=
"instrumentTypeName"
label=
"仪器分类"
/>
<el-table-column
align=
"center"
prop=
"instrumentModel"
label=
"仪器型号"
/>
<el-table-column
align=
"center"
prop=
"instrumentNum"
label=
"仪器数量"
/>
<el-table-column
align=
"center"
fixed=
"right"
label=
"操作"
>
<template
slot-scope=
"
{ row }">
<div>
<el-button
type=
"text"
size=
"small"
@
click=
"handleOption(2, row)"
>
查看
</el-button>
<el-button
type=
"text"
size=
"small"
@
click=
"handleOption(1, row)"
>
编辑
</el-button>
<el-button
type=
"text"
size=
"small"
@
click=
"handleDelete(row)"
>
删除
</el-button>
<el-button
@
click=
"handleOut(row)"
type=
"text"
size=
"small"
>
出库
</el-button>
<el-button
@
click=
"handleIn(row)"
type=
"text"
size=
"small"
>
入库
</el-button>
</div>
</
template
>
</el-table-column>
</el-table>
<!--仪器新增 弹窗 -->
<el-dialog
title=
"详细信息"
:visible
.
sync=
"dialogTableVisible"
width=
"30%"
show-close
>
<el-form
:model=
"form"
ref=
"form"
:rules=
"rules"
size=
"small"
label-width=
"108px"
>
<el-row>
<el-col
:span=
"20"
>
<el-form-item
label=
"仪器名称"
prop=
"instrumentName"
>
<el-input
v-model=
"form.instrumentName"
placeholder=
"请输入"
clearable
:disabled=
"nowType == 2 ? true : false"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"20"
>
<el-form-item
label=
"仪器分类"
prop=
"instrumentTypeName"
>
<treeselect
v-model=
"form.instrumentTypeName"
:options=
"equiList"
:normalizer=
"normalizer"
placeholder=
"选择"
clearable
style=
"width: 100%"
noOptionsText=
"暂无数据"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"20"
>
<el-form-item
label=
"仪器型号"
prop=
"instrumentModel"
>
<el-input
v-model=
"form.instrumentModel"
placeholder=
"请输入"
clearable
:disabled=
"nowType == 2 ? true : false"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"20"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
placeholder=
"请输入"
type=
"textarea"
clearable
:disabled=
"nowType == 2 ? true : false"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div
slot=
"footer"
>
<el-button
type=
"primary"
@
click=
"submitparentForm"
>
确定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
<!-- 仪器库存修改弹窗 -->
<el-dialog
title=
"仪器库存"
:visible
.
sync=
"open"
width=
"30%"
show-close
>
<el-form
:model=
"form"
ref=
"form"
size=
"small"
label-width=
"108px"
>
<el-row>
<el-col
:span=
"20"
>
<el-form-item
label=
"仪器名称"
>
<el-input
v-model=
"postForm.instrumentName"
:disabled=
"true"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"20"
>
<el-form-item
label=
"旧库存数量"
>
<el-input
v-model=
"postForm.instrumentNum"
:disabled=
"true"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"20"
>
<el-form-item
label=
"变动类型"
>
<el-select
v-model=
"postForm.variationType"
clearable
placeholder=
"请选择"
:disabled=
"true"
>
<el-option
v-for=
"dict in dict.type.variation_type"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"20"
>
<el-form-item
label=
"变动数量"
>
<el-input
v-model=
"postForm.variationNum"
@
input=
"updateNewStockNum"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"20"
>
<el-form-item
label=
"新库存数量"
>
<el-input
v-model=
"postForm.newStockNum"
:disabled=
"true"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"20"
>
<el-form-item
label=
"备注"
>
<el-input
v-model=
"postForm.remark"
placeholder=
"请输入"
type=
"textarea"
clearable
:disabled=
"isEdit"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div
slot=
"footer"
>
<el-button
type=
"primary"
@
click=
"submitInventory"
>
确定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
<!-- 分页 -->
<pagination
v-show=
"total > 0"
:total=
"total"
:page
.
sync=
"queryForm.pageNum"
:limit
.
sync=
"queryForm.pageSize"
@
pagination=
"getList"
/>
</div>
</template>
<
script
>
import
{
addInst
,
//新增仪器
editInst
,
//修改仪器
getListyq
,
//查看仪器列表
getInstxq
,
deleteInst
,
getListrk
,
getInstrumentDetail
}
from
'@/api/smartSchool/InstrumentDrugAdministration/instrumentManagement'
import
{
getList
,
//查看列表
}
from
'@/api/smartSchool/InstrumentDrugAdministration/instrumentClassification'
import
Treeselect
from
"@riophae/vue-treeselect"
;
import
"@riophae/vue-treeselect/dist/vue-treeselect.css"
;
export
default
{
name
:
'instrumentManagement'
,
components
:
{
Treeselect
},
dicts
:
[
'variation_type'
],
data
()
{
return
{
queryForm
:
{
pageNum
:
1
,
pageSize
:
10
,
instrumentName
:
""
,
instrumentTypeId
:
null
,
},
//表格数据
tableData
:
[
],
isEdit
:
false
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
equiList
:
[],
// 列表
assetsList
:
[],
tablekc
:
[],
title
:
''
,
// 弹窗
form
:
{
instrumentName
:
""
,
instrumentTypeId
:
""
,
instrumentTypeName
:
null
,
instrumentModel
:
""
,
instrumentNum
:
""
,
remark
:
""
,
},
postForm
:
{
instrumentId
:
""
,
variationType
:
""
,
oldStockNum
:
""
,
newStockNum
:
""
,
remark
:
""
,
},
// 总计
total
:
0
,
rules
:
{
instrumentName
:
[
{
required
:
true
,
message
:
"仪器名称不能为空"
,
trigger
:
"blur"
}
],
instrumentTypeId
:
[
{
required
:
true
,
message
:
"仪器分类不能为空"
,
trigger
:
"blur"
}
],
instrumentTypeName
:
[
{
required
:
true
,
message
:
"仪器类名不能为空"
,
trigger
:
"blur"
}
],
instrumentModel
:
[
{
required
:
true
,
message
:
"仪器型号不能为空"
,
trigger
:
"blur"
}
],
instrumentNum
:
[
{
required
:
true
,
message
:
"仪器数量不能为空"
,
trigger
:
"blur"
}
],
remark
:
[
{
required
:
true
,
message
:
"备注不能为空"
,
trigger
:
"blur"
}
],
},
//仪器新增/修改弹窗
dialogTableVisible
:
false
,
// 库存弹窗
open
:
false
,
nowType
:
0
,
// 0新增、1编辑、2查看
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
}
},
created
()
{
this
.
getListequ
();
this
.
getList
();
},
methods
:
{
// 搜索
getList
()
{
this
.
loading
=
true
getListyq
({
...
this
.
queryForm
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
total
=
res
.
total
;
this
.
tableData
=
res
.
rows
;
console
.
log
(
this
.
tableData
);
this
.
loading
=
false
}
})
},
//查询表单数据
getListequ
()
{
this
.
loading
=
true
;
getList
(
this
.
queryForm
).
then
(
response
=>
{
this
.
equiList
=
this
.
handleTree
(
response
.
rows
,
"id"
,
'parentId'
,
'children'
);
console
.
log
(
'this.tableData'
,
this
.
tableData
);
this
.
loading
=
false
;
})
},
/** 转换分类编码数据结构 */
normalizer
(
node
)
{
console
.
log
(
node
);
if
(
node
.
children
&&
!
node
.
children
.
length
)
{
delete
node
.
children
;
}
return
{
id
:
node
.
id
,
label
:
node
.
instrumentTypeName
,
children
:
node
.
children
};
},
// 重置
resetQuery
()
{
this
.
queryForm
=
{
pageNum
:
1
,
pageSize
:
10
,
instrumentName
:
""
,
instrumentTypeId
:
null
,
},
this
.
getList
();
},
// 0新增、1编辑、2查看
handleOption
(
type
,
item
)
{
this
.
collectionForm
=
{
id
:
''
,
instrumentName
:
""
,
instrumentTypeId
:
""
,
instrumentTypeName
:
null
,
instrumentModel
:
""
,
instrumentNum
:
""
,
remark
:
""
,
}
this
.
nowType
=
type
;
if
(
type
!=
0
)
{
const
id
=
item
.
id
;
getInstxq
(
id
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
Object
.
keys
(
this
.
form
).
forEach
(
key
=>
{
if
(
res
.
data
[
key
])
{
this
.
$set
(
this
.
form
,
key
,
res
.
data
[
key
]);
}
});
}
})
}
this
.
dialogTableVisible
=
true
},
// 计算新库存数量
updateNewStockNum
()
{
const
variationNum
=
parseFloat
(
this
.
postForm
.
variationNum
);
const
instrumentNum
=
parseFloat
(
this
.
postForm
.
instrumentNum
);
if
(
this
.
postForm
.
variationType
===
'2'
)
{
// 入库操作,新库存等于旧库存加上变动数量
this
.
postForm
.
newStockNum
=
isNaN
(
variationNum
)
||
isNaN
(
instrumentNum
)
?
0
:
variationNum
+
instrumentNum
;
}
else
if
(
this
.
postForm
.
variationType
===
'1'
)
{
// 出库操作,新库存等于旧库存减去变动数量
this
.
postForm
.
newStockNum
=
isNaN
(
variationNum
)
||
isNaN
(
instrumentNum
)
?
0
:
instrumentNum
-
variationNum
;
}
},
// 入库
handleIn
(
row
)
{
this
.
open
=
true
;
const
id
=
row
.
id
;
getInstxq
(
id
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
postForm
=
res
.
data
;
this
.
postForm
.
variationType
=
'2'
;
this
.
loading
=
false
;
this
.
isEdit
=
true
;
// 初始化新库存数量
this
.
updateNewStockNum
();
}
})
},
// 出库
handleOut
(
row
)
{
this
.
open
=
true
;
const
id
=
row
.
id
;
getInstxq
(
id
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
postForm
=
res
.
data
;
console
.
log
(
this
.
postForm
);
this
.
postForm
.
variationType
=
'1'
;
console
.
log
(
this
.
postForm
);
this
.
loading
=
false
// 初始化新库存数量
this
.
updateNewStockNum
();
}
})
},
// 入库/出库提交
submitInventory
()
{
if
(
!
this
.
postForm
.
variationNum
||
isNaN
(
this
.
postForm
.
variationNum
))
{
this
.
$message
.
error
(
'请输入正确的变动数量!'
);
return
;
}
const
postData
=
{
instrumentId
:
this
.
postForm
.
id
,
variationType
:
this
.
postForm
.
variationType
,
oldStockNum
:
this
.
postForm
.
instrumentNum
,
newStockNum
:
this
.
postForm
.
newStockNum
,
remark
:
this
.
postForm
.
remark
,
};
getInstrumentDetail
(
postData
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
'操作成功!'
);
this
.
open
=
false
;
this
.
getList
();
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
})
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
);
this
.
single
=
selection
.
length
!=
1
;
this
.
multiple
=
!
selection
.
length
;
},
// 仪器确定
submitparentForm
:
function
()
{
const
useId
=
this
.
form
.
useId
this
.
form
.
useName
=
useId
==
''
?
''
:
this
.
equiList
.
find
(
item
=>
item
.
userId
==
useId
).
userName
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
editInst
(
this
.
form
).
then
(
response
=>
{
console
.
log
(
'this.form'
,
this
.
form
);
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
dialogTableVisible
=
false
;
this
.
getList
();
this
.
enuqLeader
();
});
}
else
{
addInst
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
dialogTableVisible
=
false
;
this
.
getList
();
});
}
}
});
},
reset
()
{
// 这里需要重置对话框表单
this
.
form
=
{
id
:
null
,
instrumentName
:
null
,
instrumentTypeId
:
''
,
instrumentTypeName
:
null
,
instrumentModel
:
null
,
instrumentNum
:
null
,
remark
:
null
,
};
},
//取消按钮
cancel
()
{
this
.
dialogTableVisible
=
false
;
this
.
open
=
false
;
this
.
reset
();
},
//删除按钮操作
handleDelete
(
row
)
{
if
(
row
)
{
// 单个删除
this
.
$modal
.
confirm
(
'是否确认删除选中数据?'
).
then
(()
=>
{
this
.
$modal
.
loading
(
'正在处理数据,请稍等...'
);
return
deleteInst
(
row
.
id
);
}).
then
(
response
=>
{
this
.
$modal
.
closeLoading
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
this
.
getList
();
}).
catch
(
error
=>
{
this
.
$modal
.
closeLoading
();
});
}
else
{
// 批量删除
if
(
!
this
.
ids
||
this
.
ids
.
length
===
0
)
{
this
.
$modal
.
warning
(
"请选择要删除的数据"
);
return
;
}
this
.
$modal
.
confirm
(
'是否确认删除选中数据?'
).
then
(()
=>
{
this
.
$modal
.
loading
(
'正在处理数据,请稍等...'
);
const
deletePromises
=
this
.
ids
.
map
(
id
=>
deleteInst
(
id
));
return
Promise
.
all
(
deletePromises
);
}).
then
(
response
=>
{
this
.
$modal
.
closeLoading
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
this
.
getList
();
}).
catch
(
error
=>
{
this
.
$modal
.
closeLoading
();
});
}
}
}
}
</
script
>
<
style
scoped
></
style
>
ruoyi-ui/src/views/smartSchool/InstrumentDrugAdministration/instrumentManagement/index.vue
View file @
7032986b
...
...
@@ -56,8 +56,8 @@
</el-row>
<el-row>
<el-col
:span=
"20"
>
<el-form-item
label=
"仪器分类"
prop=
"instrumentType
Name
"
>
<treeselect
v-model=
"form.instrumentType
Name
"
:options=
"equiList"
:normalizer=
"normalizer"
<el-form-item
label=
"仪器分类"
prop=
"instrumentType
Id
"
>
<treeselect
v-model=
"form.instrumentType
Id
"
:options=
"equiList"
:normalizer=
"normalizer"
placeholder=
"选择"
clearable
style=
"width: 100%"
noOptionsText=
"暂无数据"
/>
</el-form-item>
</el-col>
...
...
@@ -90,7 +90,7 @@
<!-- 仪器库存修改弹窗 -->
<el-dialog
title=
"仪器库存"
:visible
.
sync=
"open"
width=
"30%"
show-close
>
<el-form
:model=
"
form"
ref=
"f
orm"
size=
"small"
label-width=
"108px"
>
<el-form
:model=
"
postForm"
ref=
"postF
orm"
size=
"small"
label-width=
"108px"
>
<el-row>
<el-col
:span=
"20"
>
<el-form-item
label=
"仪器名称"
>
...
...
@@ -198,7 +198,7 @@ export default {
// 弹窗
form
:
{
instrumentName
:
""
,
instrumentTypeId
:
""
,
instrumentTypeId
:
null
,
instrumentTypeName
:
null
,
instrumentModel
:
""
,
instrumentNum
:
""
,
...
...
@@ -296,10 +296,10 @@ export default {
// 0新增、1编辑、2查看
handleOption
(
type
,
item
)
{
this
.
collectionF
orm
=
{
this
.
f
orm
=
{
id
:
''
,
instrumentName
:
""
,
instrumentTypeId
:
""
,
instrumentTypeId
:
null
,
instrumentTypeName
:
null
,
instrumentModel
:
""
,
instrumentNum
:
""
,
...
...
@@ -399,36 +399,40 @@ export default {
},
// 仪器确定
submitparentForm
:
function
()
{
const
useId
=
this
.
form
.
useId
this
.
form
.
useName
=
useId
==
''
?
''
:
this
.
equiList
.
find
(
item
=>
item
.
userId
==
useId
).
userName
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
if
(
this
.
form
.
id
!=
""
)
{
// 调用修改接口
editInst
(
this
.
form
).
then
(
response
=>
{
console
.
log
(
'
this.form'
,
this
.
form
);
console
.
log
(
'
修改成功'
,
response
);
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
dialogTableVisible
=
false
;
this
.
getList
();
this
.
enuqLeader
();
}).
catch
(
error
=>
{
});
}
else
{
// 调用新增接口
addInst
(
this
.
form
).
then
(
response
=>
{
console
.
log
(
'新增成功'
,
response
);
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
dialogTableVisible
=
false
;
this
.
getList
();
}).
catch
(
error
=>
{
});
}
}
});
},
reset
()
{
// 这里需要重置对话框表单
this
.
form
=
{
id
:
null
,
instrumentName
:
null
,
instrumentTypeId
:
''
,
instrumentTypeId
:
null
,
instrumentTypeName
:
null
,
instrumentModel
:
null
,
instrumentNum
:
null
,
...
...
@@ -454,7 +458,7 @@ export default {
this
.
$modal
.
msgSuccess
(
"删除成功"
);
this
.
getList
();
}).
catch
(
error
=>
{
this
.
$modal
.
closeLoading
();
//
this.$modal.closeLoading();
});
}
else
{
// 批量删除
...
...
ruoyi-ui/src/views/smartSchool/laboratoryManagement/laboratoryManagements/laboratoryCompetition/index copy.vue
0 → 100644
View file @
7032986b
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
label-width=
"100px"
>
<el-form-item
label=
"比赛类型"
prop=
"competitionType"
>
<el-select
v-model=
"queryParams.competitionType"
placeholder=
"请选择"
clearable
>
<el-option
v-for=
"(item, index) in dict.type.competition_type"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"比赛项目名称"
prop=
"competitionName"
>
<el-input
v-model=
"queryParams.competitionName"
placeholder=
"请输入"
clearable
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"getList"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleOption(0)"
>
新增
</el-button>
</el-col>
</el-row>
<el-table
border
v-loading=
"loading"
:data=
"competitionData"
stripe
>
<el-table-column
fixed=
"left"
label=
"序号"
type=
"index"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"学年"
align=
"center"
prop=
"schoolYear"
/>
<el-table-column
label=
"参赛教师"
align=
"center"
prop=
"teacherName"
/>
<el-table-column
label=
"参赛课题"
align=
"center"
prop=
"entrySubject"
/>
<el-table-column
label=
"比赛项目名称"
align=
"center"
prop=
"competitionName"
/>
<el-table-column
align=
"center"
prop=
"competitionType"
label=
"比赛类型"
>
<template
slot-scope=
"
{ row }">
<div>
{{
selectDictLabel
(
dict
.
type
.
competition_type
,
row
.
competitionType
)
}}
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"比赛级别"
align=
"center"
prop=
"competitionLevel"
>
<
template
slot-scope=
"{ row }"
>
<div>
{{
selectDictLabel
(
dict
.
type
.
competition_level
,
row
.
competitionLevel
)
}}
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"证书照片"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div>
<el-image
v-for=
"(accessory, index) in scope.row.schoolAccessoryList"
:key=
"index"
style=
"width: 100px; height: 100px"
:src=
"accessory.accessoryUrl"
:preview-src-list=
"[accessory.accessoryUrl]"
></el-image>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"备注1"
align=
"center"
prop=
"remark1"
/>
<el-table-column
label=
"备注2"
align=
"center"
prop=
"remark2"
/>
<el-table-column
label=
"备注3"
align=
"center"
prop=
"remark3"
/>
<el-table-column
fixed=
"right"
label=
"操作"
align=
"center"
prop=
"orgname"
width=
"150"
>
<
template
slot-scope=
"{ row }"
>
<el-button
type=
"text"
size=
"small"
@
click=
"handleOption(1, row)"
>
编辑
</el-button>
<el-button
type=
"text"
size=
"small"
@
click=
"handleOption(2, row)"
>
查看
</el-button>
<el-button
type=
"text"
size=
"small"
@
click=
"handleDelete(row.id)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
ref=
"pageBlock"
v-show=
"total > 0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 新增、编辑、查看弹窗 -->
<el-dialog
title=
"详细信息"
:visible
.
sync=
"dialogVisible"
width=
"50%"
>
<el-form
:model=
"form"
ref=
"form"
size=
"small"
label-width=
"108px"
:disabled=
"isEdit"
:rules=
"rules"
>
<el-row>
<el-col
:span=
"10"
>
<el-form-item
label=
"学年"
prop=
"schoolYear"
>
<el-input
v-model=
"form.schoolYear"
placeholder=
"请输入"
clearable
:disabled=
"nowType == 2 ? true : false"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"10"
>
<el-form-item
label=
"参赛老师"
prop=
"teacherId"
>
<el-select
v-model=
"form.teacherId"
placeholder=
"请选择"
clearable
style=
"width: 100%;"
:disabled=
"nowType == 2 ? true : false"
>
<el-option
v-for=
"(item, index) in teacherList"
:key=
"index"
:label=
"item.userName"
:value=
"item.userId"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"10"
>
<el-form-item
label=
"参赛课题"
prop=
"entrySubject"
>
<el-input
v-model=
"form.entrySubject"
placeholder=
"请输入"
clearable
:disabled=
"nowType == 2 ? true : false"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"10"
>
<el-form-item
label=
"比赛项目名称"
prop=
"competitionName"
>
<el-input
v-model=
"form.competitionName"
placeholder=
"请输入"
clearable
:disabled=
"nowType == 2 ? true : false"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"10"
>
<el-form-item
label=
"比赛类型"
prop=
"competitionType"
>
<el-select
v-model=
"form.competitionType"
placeholder=
"请选择"
clearable
style=
"width: 100%;"
:disabled=
"nowType == 2 ? true : false"
>
<el-option
v-for=
"dict in dict.type.competition_type"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"10"
>
<el-form-item
label=
"比赛级别"
prop=
"competitionLevel"
>
<el-select
v-model=
"form.competitionLevel"
placeholder=
"请选择"
clearable
style=
"width: 100%;"
:disabled=
"nowType == 2 ? true : false"
>
<el-option
v-for=
"dict in dict.type.competition_level"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"10"
>
<el-form-item
prop=
"schoolAccessoryList"
label=
"证书照片"
>
<el-upload
v-loading=
"uploadLoading"
class=
"avatar-uploader"
action=
"#"
accept=
"image/*"
:show-file-list=
"false"
:on-success=
"handleAvatarSuccess"
:before-upload=
"beforeAvatarUpload"
:http-request=
"uploadImage"
>
<img
v-for=
"item in form.schoolAccessoryList"
:key=
"item.accessoryUrl"
:src=
"item.accessoryUrl"
class=
"avatar"
/>
<i
v-if=
"form.schoolAccessoryList.length === 0"
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-col>
<el-col
:span=
"10"
>
<el-form-item
label=
"备注1"
>
<el-input
v-model=
"form.remark1"
placeholder=
"请输入"
clearable
:disabled=
"nowType == 2 ? true : false"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"10"
>
<el-form-item
label=
"备注2"
>
<el-input
v-model=
"form.remark2"
placeholder=
"请输入"
clearable
:disabled=
"nowType == 2 ? true : false"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"10"
>
<el-form-item
label=
"备注3"
>
<el-input
v-model=
"form.remark3"
placeholder=
"请输入"
clearable
:disabled=
"nowType == 2 ? true : false"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
<el-dialog
ref=
"previewDialog"
title=
"预览图片"
:visible
.
sync=
"previewDialogVisible"
>
<el-image
style=
"width: 100%; max-height: 80vh; object-fit: contain"
:src=
"previewImageUrl"
fit=
"contain"
></el-image>
</el-dialog>
</div>
</template>
<
script
>
import
{
addCompetition
,
updateCompetition
,
getCompetition
,
getCompetitionxq
,
deleteCompetition
,
getTeacher
}
from
'@/api/smartSchool/laboratoryManagement/laboratoryCompetition'
import
ListImage
from
"@/components/ListImage"
;
import
{
uploadImage
as
commonUpload
}
from
'@/api/common'
import
picAvatar
from
'@/views/smartSchool/schoolManage/introduce/schoolInfo/profile/picAvatar'
export
default
{
dicts
:
[
'competition_type'
,
'competition_type'
,
'competition_level'
],
components
:
{
picAvatar
},
data
()
{
return
{
//缩略图
srcList
:
[],
// 图片路径
imageUrl
:
undefined
,
pev
:
process
.
env
.
VUE_APP_BASE_API
,
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
},
previewImageUrl
:
''
,
//获取子组件传来的信息
pic
:
[],
isEdit
:
false
,
nowType
:
0
,
// 0新增、1修改、2查看
uploadLoading
:
false
,
loading
:
false
,
total
:
0
,
competitionData
:
[],
isMultiple
:
false
,
// table是否有选择
dialogTitle
:
''
,
//弹窗标题
dialogVisible
:
false
,
nowOption
:
null
,
uploadedFiles
:
[],
form
:
{
schoolYear
:
''
,
teacherId
:
''
,
teacherName
:
''
,
entrySubject
:
''
,
competitionName
:
''
,
competitionType
:
''
,
competitionLevel
:
''
,
remark1
:
''
,
remark2
:
''
,
remark3
:
''
,
schoolAccessoryList
:
[],
},
rules
:
{
schoolYear
:
[
{
required
:
true
,
message
:
"学年不能为空"
,
trigger
:
"change"
}
],
teacherName
:
[
{
required
:
true
,
message
:
"教师名称不能为空"
,
trigger
:
"change"
}
],
entrySubject
:
[
{
required
:
true
,
message
:
"参赛课题不能为空"
,
trigger
:
"change"
}
],
competitionType
:
[
{
required
:
true
,
message
:
"比赛类型不能为空"
,
trigger
:
"change"
}
],
competitionLevel
:
[
{
required
:
true
,
message
:
"比赛级别不能为空"
,
trigger
:
"change"
}
],
// schoolAccessoryList: [
// { required: true, message: "证书照片不能为空", trigger: "change" }
// ],
competitionName
:
[
{
required
:
true
,
message
:
"比赛项目名称不能为空"
,
trigger
:
"change"
}
],
},
previewDialogVisible
:
false
,
teacherList
:
[],
nowType
:
0
,
// 0新增、1编辑、2查看
}
},
watch
:
{
pic
:
{
handler
(
newValue
,
oldValue
)
{
console
.
log
(
'watch----oldValue'
,
oldValue
)
console
.
log
(
'watch----newValue'
,
newValue
)
this
.
isUploadPic
=
newValue
[
3
]
}
}
},
mounted
()
{
this
.
getList
();
this
.
getTeacher
();
},
methods
:
{
handlePreview
(
url
)
{
this
.
previewImageUrl
=
url
;
this
.
$refs
.
previewDialog
.
open
();
},
//获取列表数据
getList
()
{
getCompetition
(
this
.
queryForm
).
then
(
response
=>
{
this
.
competitionData
=
response
.
rows
;
console
.
log
(
'response'
,
response
);
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
this
.
competitionData
.
forEach
(
item
=>
{
if
(
item
.
schoolAccessoryList
)
{
item
.
previewUrls
=
[
item
.
schoolAccessoryList
.
map
(
accessory
=>
accessory
.
accessoryUrl
)];
item
.
pictureUrl
=
item
.
schoolAccessoryList
.
map
(
accessory
=>
accessory
.
accessoryUrl
);
}
else
{
item
.
previewUrls
=
[];
item
.
pictureUrl
=
[];
}
});
});
},
//获取图片信息
getSchoolInfoPic
(
val
)
{
this
.
pic
=
val
},
// 移除图片
handleRemove
()
{
this
.
imageUrl
=
undefined
},
// 上传成功回调
handleAvatarSuccess
(
response
,
file
)
{
// 处理上传成功的逻辑
console
.
log
(
response
,
'response'
);
console
.
log
(
file
,
'file'
);
const
accessoryUrl
=
response
.
data
.
url
;
// 假设响应中包含了图片的访问URL
const
accessoryName
=
file
.
name
;
// 获取上传文件的名称
this
.
form
.
schoolAccessoryList
.
push
({
accessoryUrl
:
accessoryUrl
,
accessoryName
:
accessoryName
});
},
// 上传前格式和图片大小限制
beforeAvatarUpload
(
file
)
{
const
type
=
file
.
type
===
'image/jpeg'
||
'image/jpg'
||
'image/webp'
||
'image/png'
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
if
(
!
type
)
{
this
.
$message
.
error
(
'图片格式不正确!(只能包含jpg,png,webp,JPEG)'
)
}
if
(
!
isLt2M
)
{
this
.
$message
.
error
(
'上传图片大小不能超过 2MB!'
)
}
return
type
&&
isLt2M
},
// 上传图片
uploadImage
(
file
)
{
const
fileData
=
file
.
file
const
formData
=
new
FormData
()
formData
.
append
(
'file'
,
fileData
)
this
.
uploadLoading
=
true
commonUpload
(
formData
)
.
then
(
response
=>
{
this
.
uploadLoading
=
false
this
.
$modal
.
msgSuccess
(
'上传成功'
)
this
.
imageUrl
=
process
.
env
.
VUE_APP_BASE_API
+
response
.
url
// 添加以下代码将文件信息添加到 uploadedFiles 数组中
this
.
uploadedFiles
.
push
({
accessoryUrl
:
process
.
env
.
VUE_APP_BASE_API
+
response
.
url
,
accessoryName
:
fileData
.
name
})
})
.
catch
(
error
=>
{
this
.
uploadLoading
=
false
})
},
//重置
resetQuery
()
{
this
.
queryParams
=
{
pageNum
:
1
,
pageSize
:
10
,
competitionType
:
""
,
competitionName
:
""
,
},
this
.
getList
();
},
//删除
handleDelete
(
row
)
{
this
.
$modal
.
confirm
(
'是否确认删除选中数据?'
).
then
(()
=>
{
this
.
$modal
.
loading
(
'正在处理数据,请稍等...'
);
return
deleteCompetition
(
row
);
}).
then
(
response
=>
{
this
.
$modal
.
closeLoading
();
this
.
$modal
.
msgSuccess
(
"删除班级成功"
);
this
.
getList
();
}).
catch
(
error
=>
{
this
.
$modal
.
closeLoading
();
})
},
//编辑 0新增 1编辑 2查看
handleOption
(
type
,
row
)
{
this
.
imageUrl
=
''
;
this
.
form
=
{
id
:
''
,
schoolYear
:
''
,
teacherId
:
''
,
teacherName
:
''
,
entrySubject
:
''
,
competitionName
:
''
,
competitionType
:
''
,
competitionLevel
:
''
,
remark1
:
''
,
remark2
:
''
,
remark3
:
''
,
schoolAccessoryList
:
[],
}
this
.
nowType
=
type
;
if
(
type
!=
0
)
{
const
id
=
row
.
id
getCompetitionxq
(
id
).
then
(
response
=>
{
if
(
response
.
code
==
200
)
{
Object
.
keys
(
this
.
form
).
forEach
(
key
=>
{
if
(
response
.
data
[
key
])
{
this
.
$set
(
this
.
form
,
key
,
response
.
data
[
key
]);
}
if
(
response
.
data
.
schoolAccessoryList
&&
response
.
data
.
schoolAccessoryList
.
length
>
0
)
{
this
.
imageUrls
=
response
.
data
.
schoolAccessoryList
.
map
(
item
=>
item
.
accessoryUrl
);
// 将所有证书照片的地址赋值给 imageUrls
}
})
}
})
}
this
.
dialogVisible
=
true
;
},
//查询老师
getTeacher
()
{
getTeacher
().
then
(
response
=>
{
this
.
loading
=
false
;
this
.
teacherList
=
response
.
data
;
});
},
/** 提交按钮 */
submitForm
:
function
()
{
const
teacherId
=
this
.
form
.
teacherId
this
.
form
.
teacherName
=
teacherId
==
''
?
''
:
this
.
teacherList
.
find
(
item
=>
item
.
userId
==
teacherId
).
userName
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
""
)
{
// 清空原有图片
this
.
form
.
schoolAccessoryList
.
splice
(
0
);
for
(
let
i
=
0
;
i
<
this
.
uploadedFiles
.
length
;
i
++
)
{
const
file
=
this
.
uploadedFiles
[
i
];
this
.
form
.
schoolAccessoryList
.
push
({
accessoryUrl
:
file
.
accessoryUrl
,
accessoryName
:
file
.
accessoryName
});
}
updateCompetition
(
this
.
form
).
then
(({
code
})
=>
{
if
(
code
==
200
)
{
this
.
$modal
.
msgSuccess
(
'修改成功'
)
this
.
dialogVisible
=
false
this
.
getList
()
}
}).
catch
(()
=>
{
this
.
$modal
.
msgError
(
"修改失败"
);
});
}
else
{
// 清空原有图片
this
.
form
.
schoolAccessoryList
=
[];
for
(
let
i
=
0
;
i
<
this
.
uploadedFiles
.
length
;
i
++
)
{
const
file
=
this
.
uploadedFiles
[
i
];
this
.
form
.
schoolAccessoryList
.
push
({
accessoryUrl
:
file
.
accessoryUrl
,
accessoryName
:
file
.
accessoryName
});
}
addCompetition
(
this
.
form
).
then
(
response
=>
{
console
.
log
(
this
.
form
,
'this.form'
);
this
.
$modal
.
msgSuccess
(
'新增成功'
)
this
.
dialogVisible
=
false
this
.
getList
()
}).
catch
(()
=>
{
this
.
$modal
.
msgError
(
"新增失败"
);
});
}
}
});
},
cancel
()
{
this
.
dialogVisible
=
false
;
},
},
}
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
ruoyi-ui/src/views/smartSchool/laboratoryManagement/laboratoryManagements/laboratoryCompetition/index.vue
View file @
7032986b
...
...
@@ -73,8 +73,8 @@
</el-col>
<el-col
:span=
"10"
>
<el-form-item
label=
"参赛老师"
prop=
"teacherId"
>
<el-select
v-model=
"form.teacherId
"
placeholder=
"请选择"
clearable
style=
"width: 100%;"
:disabled=
"nowType == 2 ? true : false"
>
<el-select
v-model=
"form.teacherId
"
placeholder=
"请选择"
clearable
style=
"width: 100%;"
:disabled=
"nowType == 2 ? true : false"
>
<el-option
v-for=
"(item, index) in teacherList"
:key=
"index"
:label=
"item.userName"
:value=
"item.userId"
></el-option>
</el-select>
...
...
@@ -125,8 +125,8 @@
class=
"avatar"
/>
<i
v-if=
"form.schoolAccessoryList.length === 0"
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-form-item>
</el-col>
<el-col
:span=
"10"
>
<el-form-item
label=
"备注1"
>
...
...
@@ -386,26 +386,35 @@ export default {
remark2
:
''
,
remark3
:
''
,
schoolAccessoryList
:
[],
}
}
;
this
.
nowType
=
type
;
if
(
type
!=
0
)
{
const
id
=
row
.
id
const
id
=
row
.
id
;
getCompetitionxq
(
id
).
then
(
response
=>
{
console
.
log
(
response
.
data
,
'chakan'
);
if
(
response
.
code
==
200
)
{
Object
.
keys
(
this
.
form
).
forEach
(
key
=>
{
if
(
response
.
data
[
key
])
{
this
.
$set
(
this
.
form
,
key
,
response
.
data
[
key
]);
const
teacherId
=
this
.
form
.
teacherId
this
.
form
.
teacherName
=
teacherId
==
''
?
''
:
this
.
teacherList
.
find
(
item
=>
item
.
userId
==
teacherId
).
userName
console
.
log
(
this
.
form
.
teacherName
,
'this.form.teacherName'
);
}
if
(
response
.
data
.
schoolAccessoryList
&&
response
.
data
.
schoolAccessoryList
.
length
>
0
)
{
this
.
imageUrls
=
response
.
data
.
schoolAccessoryList
.
map
(
item
=>
item
.
accessoryUrl
);
// 将所有证书照片的地址赋值给 imageUrls
this
.
imageUrls
=
response
.
data
.
schoolAccessoryList
.
map
(
item
=>
item
.
accessoryUrl
);
}
})
});
}
})
})
;
}
this
.
dialogVisible
=
true
;
},
//查询老师
getTeacher
()
{
getTeacher
().
then
(
response
=>
{
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/controller/teacherFiles/TeacherFilesController.java
View file @
7032986b
...
...
@@ -42,6 +42,17 @@ public class TeacherFilesController extends BaseController
}
/**
* 老师查看自己的档案任务
*/
@GetMapping
(
"getTeachList/{userId}"
)
public
TableDataInfo
teachList
(
@PathVariable
(
"userId"
)
Long
userId
){
startPage
();
List
<
TeacherFilesNotice
>
teacherFilesNotices
=
teacherFilesService
.
selctTeacherByUserId
(
userId
);
return
getDataTable
(
teacherFilesNotices
);
}
/**
* 导出教师档案列表
*/
@PreAuthorize
(
"@ss.hasPermi('teacherFiles:files:export')"
)
...
...
@@ -72,6 +83,7 @@ public class TeacherFilesController extends BaseController
@PostMapping
public
AjaxResult
add
(
@RequestBody
TeacherFiles
teacherFiles
)
{
teacherFiles
.
setState
(
"0"
);
return
toAjax
(
teacherFilesService
.
insertTeacherFiles
(
teacherFiles
));
}
...
...
@@ -91,10 +103,10 @@ public class TeacherFilesController extends BaseController
*/
@PreAuthorize
(
"@ss.hasPermi('teacherFiles:files:remove')"
)
@Log
(
title
=
"教师档案"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{id}"
)
public
AjaxResult
remove
(
@PathVariable
Long
id
)
@DeleteMapping
(
"/{id
s
}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
{
return
toAjax
(
teacherFilesService
.
deleteTeacherFilesById
(
id
));
return
toAjax
(
teacherFilesService
.
deleteTeacherFilesById
s
(
ids
));
}
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/domain/teacherFiles/TeacherFilesNotice.java
View file @
7032986b
...
...
@@ -21,6 +21,8 @@ public class TeacherFilesNotice extends BaseEntity
/** id */
private
String
id
;
private
Long
fId
;
/** 范围 */
@Excel
(
name
=
"范围"
)
private
String
noticeRange
;
...
...
@@ -37,7 +39,9 @@ public class TeacherFilesNotice extends BaseEntity
@Excel
(
name
=
"通知名称"
)
private
String
noticeName
;
/** 状态 */
/** 状态
* @Excel(name = "状态 (1未发布 2已发布 3已填写 4已提交 5已确认 9驳回)" )
* */
@Excel
(
name
=
"状态"
)
private
String
noticeState
;
...
...
@@ -51,5 +55,10 @@ public class TeacherFilesNotice extends BaseEntity
@Excel
(
name
=
"结束时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
endTime
;
/**
* 填写状态 (1未发布 2已发布 3已填写 4已提交 5已确认 9驳回)"
*/
private
String
state
;
}
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/schoolClass/SchoolClassMapper.java
View file @
7032986b
...
...
@@ -68,4 +68,6 @@ public interface SchoolClassMapper extends BaseMapper<SchoolClass> {
List
<
Long
>
getClassesIdByGradeId
(
Long
gradeId
);
public
Long
selectDdClassId
(
String
ddClssId
);
List
<
SchoolClassVo
>
selectTeacherByTeachId
(
Long
teachId
);
}
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/schoolCurriculum/SchoolCurriculumMapper.java
View file @
7032986b
...
...
@@ -2,8 +2,12 @@ package yangtz.cs.liu.campus.mapper.schoolCurriculum;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Select
;
import
yangtz.cs.liu.campus.domain.schoolCurriculum.SchoolCurriculum
;
@Mapper
public
interface
SchoolCurriculumMapper
extends
BaseMapper
<
SchoolCurriculum
>
{
@Select
(
"select * from school_curriculum where course_name =#{name}"
)
SchoolCurriculum
selectCourseName
(
String
name
);
}
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/schoolgrade/SchoolGradeMapper.java
View file @
7032986b
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade
;
import
yangtz.cs.liu.campus.domain.schoolgrade.SchoolGradeMentor
;
import
yangtz.cs.liu.campus.vo.schoolgrade.SchoolGradeMentorVo
;
...
...
@@ -25,8 +26,15 @@ public interface SchoolGradeMapper extends BaseMapper<SchoolGrade> {
List
<
Long
>
getGradeIdsByYear
(
int
schoolYear
);
@Select
(
"SELECT school_year FROM school_grade GROUP BY school_year"
)
List
<
String
>
selectSchoolYearGruoUp
();
//获取最新学年
int
isNewSchoolYear
();
SchoolGrade
selectGradeByName
(
String
name
);
public
List
<
String
>
getYearList
();
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/teacher/SchoolTeacherMapper.java
View file @
7032986b
...
...
@@ -48,6 +48,8 @@ public interface SchoolTeacherMapper extends BaseMapper<SchoolTeacher>{
*/
SchoolTeacher
selectTeacher
(
String
teacherIdCard
);
SchoolTeacher
selectTeacherByDdUerId
(
String
dduserId
);
/**
* 微信公众号(通过姓名查询)
* @param teacherName
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/teacherFiles/TeacherFilesNoticeMapper.java
View file @
7032986b
package
yangtz
.
cs
.
liu
.
campus
.
mapper
.
teacherFiles
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice
;
import
yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNoticeTotal
;
import
yangtz.cs.liu.campus.vo.teacherFiles.SchoolClassByGradeVo
;
...
...
@@ -40,6 +41,10 @@ public interface TeacherFilesNoticeMapper
*/
public
int
insertTeacherFilesNotice
(
TeacherFilesNotice
teacherFilesNotice
);
@Select
(
"SELECT fn.*,tf.state,tf.id as fId from teacher_files tf LEFT JOIN teacher_files_notice fn on fn.id= tf.notice_id WHERE tf.teacher_id = #{userId} and fn.notice_state = 2"
)
public
List
<
TeacherFilesNotice
>
selctTeacherByUserId
(
Long
userId
);
/**
* 修改教师档案通知
*
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolLab/SchoolLabClassYearServiceImpl.java
View file @
7032986b
...
...
@@ -98,7 +98,13 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
@Override
public
SchoolLabClassYearVo
selectSchoolLabClassYearById
(
Long
id
)
{
return
schoolLabClassYearMapper
.
selectSchoolLabClassYearById
(
id
);
SchoolLabClassYearVo
schoolLabClassYearVo
=
schoolLabClassYearMapper
.
selectSchoolLabClassYearById
(
id
);
LambdaQueryWrapper
<
SchoolLabClassYearRelation
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SchoolLabClassYearRelation:
:
getLabClassYearId
,
schoolLabClassYearVo
.
getId
());
List
<
SchoolLabClassYearRelation
>
relations
=
relationMapper
.
selectList
(
wrapper
);
schoolLabClassYearVo
.
setSchoolLabClassYearRelationList
(
relations
);
return
schoolLabClassYearVo
;
}
/**
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolgrade/ISchoolGradeImpl.java
View file @
7032986b
...
...
@@ -47,6 +47,12 @@ public class ISchoolGradeImpl extends ServiceImpl<SchoolGradeMapper, SchoolGrade
return
schoolGradeMapper
.
selectList
(
lqw
);
}
@Override
public
List
<
String
>
selectSchoolYearGruoUp
()
{
return
schoolGradeMapper
.
selectSchoolYearGruoUp
();
}
//判断所在班级所在级部(存在一个老师跨几个级部教学,比如体育老师,所以获取教授班级所在级部,随便选择某个级部即可)
@Override
public
Long
getGradeId
(
Long
userId
)
{
...
...
@@ -120,6 +126,12 @@ public class ISchoolGradeImpl extends ServiceImpl<SchoolGradeMapper, SchoolGrade
return
resList
;
}
@Override
public
SchoolGrade
selectGradeByName
(
String
gradName
)
{
return
schoolGradeMapper
.
selectGradeByName
(
gradName
);
}
/**
* 升级
* (初始化三条数据后,可进行升级操作,新插入一条级部信息,上两个级部的学年和年级自动+1)
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/teacherFiles/TeacherFilesNoticeServiceImpl.java
View file @
7032986b
package
yangtz
.
cs
.
liu
.
campus
.
service
.
impl
.
teacherFiles
;
import
com.ruoyi.common.core.domain.entity.SchoolTeacher
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.system.mapper.SysDeptMapper
;
import
com.ruoyi.system.mapper.SysUserMapper
;
import
org.apache.catalina.User
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
yangtz.cs.liu.campus.controller.A
;
import
yangtz.cs.liu.campus.domain.schoolClass.SchoolClass
;
import
yangtz.cs.liu.campus.domain.schoolClass.SchoolClassMentor
;
import
yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade
;
import
yangtz.cs.liu.campus.domain.teacherFiles.TeacherFiles
;
import
yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice
;
import
yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNoticeTotal
;
import
yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMapper
;
import
yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMentorMapper
;
import
yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper
;
import
yangtz.cs.liu.campus.mapper.teacher.SchoolTeacherMapper
;
import
yangtz.cs.liu.campus.mapper.teacherFiles.TeacherFilesMapper
;
import
yangtz.cs.liu.campus.mapper.teacherFiles.TeacherFilesNoticeMapper
;
import
yangtz.cs.liu.campus.service.schoolClass.ISchoolClassMentorService
;
import
yangtz.cs.liu.campus.service.schoolClass.ISchoolClassService
;
import
yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeService
;
import
yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesNoticeService
;
import
yangtz.cs.liu.campus.vo.teacherFiles.SchoolClassByGradeVo
;
import
yangtz.cs.liu.campus.vo.teacherFiles.SchoolGradeByClassVo
;
import
yangtz.cs.liu.wechat.vo.schoolClass.SchoolClassVo
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -42,7 +58,18 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService
private
SchoolTeacherMapper
schoolTeacherMapper
;
@Autowired
private
SysDeptMapper
sysDeptMapper
;
@Autowired
private
SysUserMapper
sysUserMapper
;
@Autowired
private
SchoolClassMapper
schoolClassMapper
;
@Autowired
private
SchoolClassMentorMapper
classMentorMapper
;
@Autowired
private
SchoolGradeMapper
gradeMapper
;
/**
* 教师教室档案通知
*
...
...
@@ -85,87 +112,157 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService
teacherFilesNotice
.
setCreateTime
(
DateUtils
.
getNowDate
());
int
i
=
teacherFilesNoticeMapper
.
insertTeacherFilesNotice
(
teacherFilesNotice
);
//获取所有带级部的部门
List
<
SysDept
>
sysDepts
=
sysDeptMapper
.
selectDepartmentDept
(
"级部"
);
List
<
SysUser
>
userList
=
new
ArrayList
<>();
for
(
SysDept
dept
:
sysDepts
){
String
[]
split
=
dept
.
getAncestors
().
split
(
","
);
if
(
split
.
length
!=
2
){
continue
;
}
//找到每一个级部下所有的人员
List
<
SysUser
>
sysUsers
=
sysUserMapper
.
selectDeptAncetorsByPernId
(
dept
.
getDeptId
().
toString
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"gruop"
,
dept
.
getDeptName
());
//获取级部
List
<
SchoolGrade
>
schoolGrades
=
schoolGradeMapper
.
selectNowSchoolGrade
();
for
(
SchoolGrade
schoolGrade:
schoolGrades
){
sysUsers
.
forEach
(
date
->{
date
.
setParams
(
map
);
});
userList
.
addAll
(
sysUsers
);
}
//获取所有老师 去重
List
<
SysUser
>
trrUserList
=
userList
.
stream
().
collect
(
Collectors
.
collectingAndThen
(
Collectors
.
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
SysUser
::
getUserId
))),
ArrayList:
:
new
));
List
<
TeacherFiles
>
teacherFilesList
=
new
ArrayList
<>();
for
(
SysUser
user
:
trrUserList
){
//部门
Map
<
String
,
Object
>
params
=
user
.
getParams
();
String
gruopName
=
(
String
)
params
.
get
(
"gruop"
);
//获取级部
SchoolGrade
schoolGrade
=
schoolGradeMapper
.
selectGradeByName
(
gruopName
);
//查看当前老师是否在班级中当班主任
//通知所有教师
List
<
SchoolClassVo
>
schoolClassVos
=
schoolClassMapper
.
selectTeacherByTeachId
(
user
.
getUserId
());
String
teahClassName
=
null
;
String
className
=
null
;
//只取第一个
if
(!
schoolClassVos
.
isEmpty
()){
teahClassName
=
schoolClassVos
.
get
(
0
).
getClassName
();
className
=
schoolClassVos
.
get
(
0
).
getClassName
();
}
//班主任信息
TeacherFiles
teacherFiles
=
new
TeacherFiles
();
teacherFiles
.
setTeacherId
(
user
.
getUserId
());
teacherFiles
=
teacherFilesAddXx
(
teacherFiles
);
teacherFiles
.
setNoticeId
(
noticeId
);
teacherFiles
.
setFilesSemester
(
teacherFilesNotice
.
getNoticeYear
()+
"学年"
+
teacherFilesNotice
.
getNoticeSemester
());
teacherFiles
.
setGradeId
(
schoolGrade
.
getId
());
teacherFiles
.
setGradeName
(
schoolGrade
.
getGradeName
());
teacherFiles
.
setBzrClassName
(
teahClassName
);
teacherFiles
.
setState
(
"2"
);
teacherFiles
=
teacherFilesAddXx
(
teacherFiles
);
//老师个人信息
//找到老师课程
// TODO 修改最新学年
int
schoolYear
=
gradeMapper
.
isNewSchoolYear
();
List
<
SchoolClassMentor
>
mentorByTeacherId
=
classMentorMapper
.
getMentorByTeacherId
(
user
.
getUserId
(),
schoolYear
);
if
(!
mentorByTeacherId
.
isEmpty
()){
teacherFiles
.
setCourseName
(
mentorByTeacherId
.
get
(
0
).
getCourseName
());
if
(
StringUtils
.
isEmpty
(
className
)){
//根据课程关联找寻班级
SchoolClass
schoolClass
=
schoolClassMapper
.
selectById
(
mentorByTeacherId
.
get
(
0
).
getClassId
());
className
=
schoolClass
.
getClassName
();
}
}
teacherFiles
.
setClassName
(
className
);
teacherFilesList
.
add
(
teacherFiles
);
}
//导入数据库
teacherFilesList
.
forEach
(
date
->{
teacherFilesMapper
.
insertTeacherFiles
(
date
);
});
Map
<
Long
,
TeacherFiles
>
teacherFilesMap
=
new
HashMap
();
Long
gradeId
=
schoolGrade
.
getId
();
String
gradeName
=
schoolGrade
.
getGradeName
();
//获取班级
List
<
SchoolClassByGradeVo
>
schoolClassByGrade
=
teacherFilesNoticeMapper
.
getSchoolClassByGrade
(
gradeId
);
for
(
SchoolClassByGradeVo
schoolClass:
schoolClassByGrade
){
Long
classId
=
schoolClass
.
getId
();
String
classAlias
=
schoolClass
.
getClassAlias
();
System
.
out
.
println
(
classAlias
);
if
(
schoolClass
.
getTeacherId
()!=
null
){
if
(
teacherFilesMap
.
get
(
schoolClass
.
getTeacherId
())==
null
){
TeacherFiles
teacherFiles
=
new
TeacherFiles
();
teacherFiles
.
setTeacherId
(
schoolClass
.
getTeacherId
());
teacherFiles
=
teacherFilesAddXx
(
teacherFiles
);
teacherFiles
.
setNoticeId
(
noticeId
);
teacherFiles
.
setFilesSemester
(
teacherFilesNotice
.
getNoticeYear
()+
"学年"
+
teacherFilesNotice
.
getNoticeSemester
());
teacherFiles
.
setGradeId
(
gradeId
);
teacherFiles
.
setGradeName
(
gradeName
);
teacherFiles
.
setBzrClassName
(
classAlias
);
teacherFiles
.
setState
(
"1"
);
teacherFilesMap
.
put
(
schoolClass
.
getTeacherId
(),
teacherFiles
);
}
else
{
TeacherFiles
teacherFiles
=
teacherFilesMap
.
get
(
schoolClass
.
getTeacherId
());
String
bzrClassName
=
teacherFiles
.
getBzrClassName
();
if
(
bzrClassName
==
null
){
teacherFiles
.
setBzrClassName
(
classAlias
);
}
else
{
teacherFiles
.
setBzrClassName
(
teacherFiles
.
getBzrClassName
()+
"、"
+
classAlias
);
}
teacherFilesMap
.
put
(
schoolClass
.
getTeacherId
(),
teacherFiles
);
}
}
//获取班级老师
List
<
SchoolGradeByClassVo
>
schoolGradeByClassVos
=
teacherFilesNoticeMapper
.
selectTeacherByClass
(
classId
);
for
(
SchoolGradeByClassVo
grade:
schoolGradeByClassVos
){
if
(
teacherFilesMap
.
get
(
grade
.
getTeacherId
())==
null
){
//没有记录
TeacherFiles
teacherFiles
=
new
TeacherFiles
();
teacherFiles
.
setTeacherId
(
grade
.
getTeacherId
());
teacherFiles
=
teacherFilesAddXx
(
teacherFiles
);
teacherFiles
.
setNoticeId
(
noticeId
);
teacherFiles
.
setFilesSemester
(
teacherFilesNotice
.
getNoticeYear
()+
"学年"
+
teacherFilesNotice
.
getNoticeSemester
());
teacherFiles
.
setGradeId
(
gradeId
);
teacherFiles
.
setGradeName
(
gradeName
);
teacherFiles
.
setCourseName
(
grade
.
getCourseName
());
teacherFiles
.
setClassName
(
classAlias
);
teacherFiles
.
setState
(
"1"
);
teacherFilesMap
.
put
(
grade
.
getTeacherId
(),
teacherFiles
);
}
else
{
//有记录
TeacherFiles
teacherFiles
=
teacherFilesMap
.
get
(
schoolClass
.
getTeacherId
());
if
(
teacherFiles
.
getClassName
()==
null
){
teacherFiles
.
setClassName
(
classAlias
);
}
else
{
if
(!
teacherFiles
.
getClassName
().
contains
(
classAlias
)){
teacherFiles
.
setClassName
(
teacherFiles
.
getClassName
()+
"、"
+
classAlias
);
}
}
if
(
teacherFiles
.
getCourseName
()==
null
){
teacherFiles
.
setCourseName
(
grade
.
getCourseName
());
}
else
{
if
(!
teacherFiles
.
getCourseName
().
contains
(
grade
.
getCourseName
())){
teacherFiles
.
setCourseName
(
teacherFiles
.
getCourseName
()+
"、"
+
grade
.
getCourseName
());
}
}
teacherFilesMap
.
put
(
schoolClass
.
getTeacherId
(),
teacherFiles
);
}
}
}
teacherFilesMap
.
forEach
((
teacherId
,
teacherFiles
)->{
teacherFilesMapper
.
insertTeacherFiles
(
teacherFiles
);
});
}
// //获取级部
// List<SchoolGrade> schoolGrades = schoolGradeMapper.selectNowSchoolGrade();
// for(SchoolGrade schoolGrade:schoolGrades){
// Map<Long,TeacherFiles> teacherFilesMap = new HashMap();
// Long gradeId = schoolGrade.getId();
// String gradeName = schoolGrade.getGradeName();
// //获取班级
// List<SchoolClassByGradeVo> schoolClassByGrade = teacherFilesNoticeMapper.getSchoolClassByGrade(gradeId);
// for(SchoolClassByGradeVo schoolClass:schoolClassByGrade){
// Long classId=schoolClass.getId();
// String classAlias=schoolClass.getClassAlias();
//
// if(schoolClass.getTeacherId()!=null){
// if(teacherFilesMap.get(schoolClass.getTeacherId())==null){
// TeacherFiles teacherFiles = new TeacherFiles();
// teacherFiles.setTeacherId(schoolClass.getTeacherId());
// teacherFiles = teacherFilesAddXx(teacherFiles);
// teacherFiles.setNoticeId(noticeId);
// teacherFiles.setFilesSemester(teacherFilesNotice.getNoticeYear()+"学年"+teacherFilesNotice.getNoticeSemester());
// teacherFiles.setGradeId(gradeId);
// teacherFiles.setGradeName(gradeName);
// teacherFiles.setBzrClassName(classAlias);
// teacherFiles.setState("1");
// teacherFilesMap.put(schoolClass.getTeacherId(),teacherFiles);
// }else{
// TeacherFiles teacherFiles = teacherFilesMap.get(schoolClass.getTeacherId());
// String bzrClassName = teacherFiles.getBzrClassName();
// if(bzrClassName==null){
// teacherFiles.setBzrClassName(classAlias);
// }else{
// teacherFiles.setBzrClassName(teacherFiles.getBzrClassName()+"、"+classAlias);
// }
// teacherFilesMap.put(schoolClass.getTeacherId(),teacherFiles);
// }
//
// }
// //获取班级老师
// List<SchoolGradeByClassVo> schoolGradeByClassVos = teacherFilesNoticeMapper.selectTeacherByClass(classId);
// for(SchoolGradeByClassVo grade:schoolGradeByClassVos){
//
// if(teacherFilesMap.get(grade.getTeacherId())==null){
// //没有记录
// TeacherFiles teacherFiles = new TeacherFiles();
// teacherFiles.setTeacherId(grade.getTeacherId());
// teacherFiles = teacherFilesAddXx(teacherFiles);
// teacherFiles.setNoticeId(noticeId);
// teacherFiles.setFilesSemester(teacherFilesNotice.getNoticeYear()+"学年"+teacherFilesNotice.getNoticeSemester());
// teacherFiles.setGradeId(gradeId);
// teacherFiles.setGradeName(gradeName);
// teacherFiles.setCourseName(grade.getCourseName());
// teacherFiles.setClassName(classAlias);
// teacherFiles.setState("1");
// teacherFilesMap.put(grade.getTeacherId(),teacherFiles);
// }else{
// //有记录
// TeacherFiles teacherFiles = teacherFilesMap.get(schoolClass.getTeacherId());
// if(teacherFiles.getClassName()==null){
// teacherFiles.setClassName(classAlias);
// }else{
// if(!teacherFiles.getClassName().contains(classAlias)){
// teacherFiles.setClassName(teacherFiles.getClassName()+"、"+classAlias);
// }
// }
// if(teacherFiles.getCourseName()==null){
// teacherFiles.setCourseName(grade.getCourseName());
// }else{
// if(!teacherFiles.getCourseName().contains(grade.getCourseName())){
// teacherFiles.setCourseName(teacherFiles.getCourseName()+"、"+grade.getCourseName());
// }
// }
// teacherFilesMap.put(schoolClass.getTeacherId(),teacherFiles);
// }
// }
// }
// teacherFilesMap.forEach((teacherId,teacherFiles)->{
// teacherFilesMapper.insertTeacherFiles(teacherFiles);
// });
// }
return
i
;
}
...
...
@@ -210,12 +307,14 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService
@Override
public
int
release
(
String
id
)
{
//通知
TeacherFilesNotice
teacherFilesNotice
=
new
TeacherFilesNotice
();
teacherFilesNotice
.
setId
(
id
);
teacherFilesNotice
.
setUpdateTime
(
DateUtils
.
getNowDate
());
teacherFilesNotice
.
setNoticeState
(
"2"
);
int
i
=
teacherFilesMapper
.
updateTeacherFilesState
(
id
);
teacherFilesNoticeMapper
.
updateTeacherFilesNotice
(
teacherFilesNotice
);
//修改任务状态
int
i
=
teacherFilesMapper
.
updateTeacherFilesState
(
id
);
return
i
;
}
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/teacherFiles/TeacherFilesServiceImpl.java
View file @
7032986b
...
...
@@ -74,6 +74,12 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService
return
teacherFilesMapper
.
selectTeacherFilesList
(
teacherFiles
);
}
@Override
public
List
<
TeacherFilesNotice
>
selctTeacherByUserId
(
Long
userId
)
{
return
teacherFilesNoticeMapper
.
selctTeacherByUserId
(
userId
);
}
/**
* 新增教师档案
*
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/service/schoolgrade/ISchoolGradeService.java
View file @
7032986b
...
...
@@ -14,6 +14,8 @@ public interface ISchoolGradeService extends IService<SchoolGrade> {
List
<
SchoolGrade
>
queryList
(
SchoolGrade
schoolGrade
);
List
<
String
>
selectSchoolYearGruoUp
();
Long
getGradeId
(
Long
userId
);
Long
getMemberGrade
(
Long
userId
);
...
...
@@ -22,6 +24,7 @@ public interface ISchoolGradeService extends IService<SchoolGrade> {
List
<
GradeTreeSelect
>
buildGradeTreeList
(
List
<
SchoolGrade
>
gradeList
);
int
upgrade
();
SchoolGrade
selectGradeByName
(
String
gradName
);
//获取最新学年
int
isNewSchoolYear
();
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/service/student/ISchoolStudentService.java
View file @
7032986b
...
...
@@ -57,14 +57,14 @@ public interface ISchoolStudentService extends IService<SchoolStudent> {
* @param teacherId
* @return
*/
Long
getDdUserId
(
String
foUserId
);
List
<
SchoolStudent
>
getMemberByTeacher
(
Long
teacherId
);
/**
* 根据dduserId查找id
* @param teacherId
* @return
*/
List
<
SchoolStudent
>
getMemberByTeacher
(
Long
teacherId
);
Long
getDdUserId
(
String
foUserId
);
/**
* 家长查看班级其他同学
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/service/teacherFiles/ITeacherFilesService.java
View file @
7032986b
package
yangtz
.
cs
.
liu
.
campus
.
service
.
teacherFiles
;
import
yangtz.cs.liu.campus.domain.teacherFiles.TeacherFiles
;
import
yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice
;
import
yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesVO
;
import
java.util.List
;
...
...
@@ -28,6 +29,7 @@ public interface ITeacherFilesService
* @return 教师档案集合
*/
public
List
<
TeacherFiles
>
selectTeacherFilesList
(
TeacherFiles
teacherFiles
);
public
List
<
TeacherFilesNotice
>
selctTeacherByUserId
(
Long
userId
);
/**
* 新增教师档案
...
...
smart-campus/src/main/java/yangtz/cs/liu/dingding/controller/DingJiaXiaoController.java
View file @
7032986b
...
...
@@ -8,6 +8,8 @@ import com.alibaba.fastjson2.JSONObject;
import
com.ruoyi.common.core.domain.entity.SchoolTeacher
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.system.mapper.SysDeptMapper
;
import
com.ruoyi.system.service.ISysDictDataService
;
import
com.ruoyi.system.service.ISysUserService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -18,12 +20,13 @@ import org.springframework.web.bind.annotation.RestController;
import
yangtz.cs.liu.campus.domain.schoolClass.SchoolClass
;
import
yangtz.cs.liu.campus.domain.schoolClass.SchoolClassHeadmaster
;
import
yangtz.cs.liu.campus.domain.schoolClass.SchoolClassMentor
;
import
yangtz.cs.liu.campus.domain.schoolCurriculum.SchoolCurriculum
;
import
yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade
;
import
yangtz.cs.liu.campus.domain.schoolgrade.SchoolGradeMentor
;
import
yangtz.cs.liu.campus.domain.student.SchoolStudent
;
import
yangtz.cs.liu.campus.domain.student.SchoolStudentClassRelation
;
import
yangtz.cs.liu.campus.domain.student.SchoolStudentClasses
;
import
yangtz.cs.liu.campus.domain.student.SchoolStudentParent
;
import
yangtz.cs.liu.campus.mapper.schoolCurriculum.SchoolCurriculumMapper
;
import
yangtz.cs.liu.campus.service.schoolClass.ISchoolClassHeadmasterService
;
import
yangtz.cs.liu.campus.service.schoolClass.ISchoolClassMentorService
;
import
yangtz.cs.liu.campus.service.schoolClass.ISchoolClassService
;
...
...
@@ -34,7 +37,6 @@ import yangtz.cs.liu.campus.service.student.ISchoolStudentClassesService;
import
yangtz.cs.liu.campus.service.student.ISchoolStudentParentService
;
import
yangtz.cs.liu.campus.service.student.ISchoolStudentService
;
import
yangtz.cs.liu.campus.service.teacher.ISchoolTeacherService
;
import
yangtz.cs.liu.campus.vo.student.SchoolStudentVO
;
import
yangtz.cs.liu.campus.vo.teacher.SchoolTeacherVO
;
import
yangtz.cs.liu.dingding.utils.AccessTokenUtils
;
import
yangtz.cs.liu.dingding.vo.DingJiaXiaoVo
;
...
...
@@ -95,11 +97,18 @@ public class DingJiaXiaoController {
@Autowired
ISysUserService
sysUserService
;
@Autowired
SysDeptMapper
sysDeptMapper
;
@Autowired
SchoolCurriculumMapper
schoolCurriculumMapper
;
public
List
<
String
>
userTypes
=
new
ArrayList
<
String
>(){
{
this
.
add
(
"teacher"
);
this
.
add
(
"guardian"
);
this
.
add
(
"student"
);
this
.
add
(
"guardian"
);
}
};
...
...
@@ -296,11 +305,6 @@ public class DingJiaXiaoController {
continue
;
}
SchoolTeacher
classHeadTeacher
=
schoolTeacherCopies
.
get
(
0
);
//职工跟年级关系
SchoolGradeMentor
schoolGradeMentor
=
new
SchoolGradeMentor
();
schoolGradeMentor
.
setTeacherId
(
classHeadTeacher
.
getId
());
schoolGradeMentor
.
setGradeId
(
date
.
getGradeId
());
schoolGradeMentorService
.
save
(
schoolGradeMentor
);
if
(
"1"
.
equals
(
teachDate
.
getIsAdviser
())){
//当前老师是班主任 记录班主任跟班级关系
SchoolClassHeadmaster
schoolClassHeadmaster
=
new
SchoolClassHeadmaster
();
...
...
@@ -315,11 +319,17 @@ public class DingJiaXiaoController {
schoolClassss
.
setTeacherTel
(
classHeadTeacher
.
getTeacherTel
());
iSchoolClassService
.
updateById
(
schoolClassss
);
}
else
{
//查找部门 课程没有编写
SysUser
sysUser
=
sysUserService
.
selectUserById
(
classHeadTeacher
.
getId
());
String
deptName
=
sysUser
.
getDept
().
getDeptName
();
//根据部门查找课程信息
SchoolCurriculum
schoolCurriculum
=
schoolCurriculumMapper
.
selectCourseName
(
deptName
);
//任课老师 跟班级关系
SchoolClassMentor
schoolClassMentor
=
new
SchoolClassMentor
();
schoolClassMentor
.
setTeacherId
(
classHeadTeacher
.
getId
());
schoolClassMentor
.
setClassId
(
date
.
getId
());
//查找部门 课程没有编写
schoolClassMentor
.
setCourseName
(
schoolCurriculum
.
getCourseName
());
schoolClassMentor
.
setCourseId
(
schoolCurriculum
.
getId
());
schoolClassMentorService
.
save
(
schoolClassMentor
);
}
}
...
...
@@ -348,21 +358,13 @@ public class DingJiaXiaoController {
schoolStudentClasses
.
setTeacherName
(
school
.
getTeacherName
());
schoolStudentClassesService
.
save
(
schoolStudentClasses
);
}
}
else
if
(
type
.
equals
(
"guardian"
))
{
//监护人
guardianUserInfos
=
this
.
addUserList
(
token
,
type
,
date
.
getDdClassId
());
for
(
DingJiaXiaoVo
.
StudentUserInfo
guarDate
:
guardianUserInfos
){
//找寻学生
String
toUserId
=
this
.
getToUserId
(
token
,
guarDate
.
getUserId
(),
date
.
getDdClassId
());
SchoolStudentVO
schoolStudentVO
=
new
SchoolStudentVO
();
schoolStudentVO
.
setDdUserId
(
toUserId
);
List
<
SchoolStudentVO
>
schoolStudentVOS
=
schoolStudentService
.
queryList
(
schoolStudentVO
);
Long
studenId
=
null
;
if
(!
schoolStudentVOS
.
isEmpty
()){
studenId
=
schoolStudentVOS
.
get
(
0
).
getId
();
}
Long
ddUserId
=
schoolStudentService
.
getDdUserId
(
toUserId
);
//创建用户user表
SysUser
jUser
=
new
SysUser
();
...
...
@@ -375,12 +377,13 @@ public class DingJiaXiaoController {
jUser
.
setStatus
(
"0"
);
jUser
.
setDelFlag
(
"0"
);
jUser
.
setUnionId
(
guarDate
.
getUnionid
());
jUser
.
setDdUserId
(
guarDate
.
getUserId
());
jUser
.
setRoleIds
(
new
Long
[]{
111L
});
jUser
.
setStudentId
(
studen
Id
);
jUser
.
setStudentId
(
ddUser
Id
);
sysUserService
.
insertUser
(
jUser
);
//家长表
SchoolStudentParent
schoolStudentParent
=
new
SchoolStudentParent
()
;
schoolStudentParent
.
setStudentId
(
studen
Id
);
//家长表
SchoolStudentParent
schoolStudentParent
=
new
SchoolStudentParent
()
;
schoolStudentParent
.
setStudentId
(
ddUser
Id
);
schoolStudentParent
.
setUserId
(
jUser
.
getUserId
());
schoolStudentParent
.
setParentName
(
guarDate
.
getName
());
schoolStudentParent
.
setTelephone
(
guarDate
.
getMobile
());
...
...
@@ -394,11 +397,11 @@ public class DingJiaXiaoController {
return
""
;
return
"
完成
"
;
}
//获取监护人详情 获取学生userid
p
rivate
String
getToUserId
(
String
token
,
String
fromUserId
,
String
classId
){
p
ublic
String
getToUserId
(
String
token
,
String
fromUserId
,
String
classId
){
String
toUserId
=
null
;
JSONObject
bjParme
=
new
JSONObject
();
bjParme
.
put
(
"from_userid"
,
fromUserId
);
...
...
@@ -406,7 +409,7 @@ public class DingJiaXiaoController {
String
bjPost
=
HttpUtil
.
post
(
"https://oapi.dingtalk.com/topapi/edu/user/relation/get?access_token="
+
token
,
bjParme
);
JSONObject
bjObject
=
JSONObject
.
parseObject
(
bjPost
);
if
((
Integer
)
bjObject
.
get
(
"errcode"
)
!=
0
){
throw
new
RuntimeException
(
"获取班级列表失败"
);
throw
new
RuntimeException
(
"获取班级列表失败"
+
bjPost
);
}
JSONArray
jsonArray
=
bjObject
.
getJSONObject
(
"result"
).
getJSONArray
(
"relations"
);
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++){
...
...
smart-campus/src/main/java/yangtz/cs/liu/dingding/controller/dingEvent/DingEventController.java
View file @
7032986b
...
...
@@ -77,7 +77,40 @@ public class DingEventController {
}
else
if
(
"bpms_task_change"
.
equals
(
eventType
)){
// 处理审批任务事件
eventJson
.
get
(
""
);
}
else
{
}
else
if
(
"edu_user_insert"
.
equals
(
eventType
)){
// 家校人员身份新增
ddUserService
.
xjUserAdd
(
eventJson
);
}
else
if
(
"edu_user_update"
.
equals
(
eventType
)){
// 家校人员身份更新
eventJson
.
get
(
""
);
}
else
if
(
"edu_user_delete"
.
equals
(
eventType
)){
// 家校人员身份删除
eventJson
.
get
(
""
);
}
else
if
(
"edu_user_relation_insert"
.
equals
(
eventType
)){
// 家校人员关系新增
eventJson
.
get
(
""
);
}
else
if
(
"edu_user_relation_update"
.
equals
(
eventType
)){
// 家校人员关系更新
eventJson
.
get
(
""
);
}
else
if
(
"edu_user_relation_delete"
.
equals
(
eventType
)){
// 家校人员关系删除
eventJson
.
get
(
""
);
}
else
if
(
"edu_dept_insert"
.
equals
(
eventType
)){
// 家校部门 节点新增
eventJson
.
get
(
""
);
}
else
if
(
"edu_dept_update"
.
equals
(
eventType
)){
// 家校部门 节点更新
eventJson
.
get
(
""
);
}
else
if
(
"edu_dept_delete"
.
equals
(
eventType
)){
// 家校部门 节点更新
eventJson
.
get
(
""
);
}
else
{
// 添加其他已注册的
log
.
info
(
"发生了:"
+
eventType
+
"事件"
);
}
...
...
smart-campus/src/main/java/yangtz/cs/liu/dingding/service/impl/dingUser/DdUserServiceImpl.java
View file @
7032986b
package
yangtz
.
cs
.
liu
.
dingding
.
service
.
impl
.
dingUser
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson2.JSONArray
;
import
com.dingtalk.api.response.OapiUserListidResponse
;
import
com.dingtalk.api.response.OapiV2UserGetResponse
;
import
com.ruoyi.common.core.domain.entity.SchoolTeacher
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.system.service.ISysUserService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
yangtz.cs.liu.campus.domain.schoolClass.SchoolClass
;
import
yangtz.cs.liu.campus.domain.schoolClass.SchoolClassHeadmaster
;
import
yangtz.cs.liu.campus.domain.schoolClass.SchoolClassMentor
;
import
yangtz.cs.liu.campus.domain.schoolCurriculum.SchoolCurriculum
;
import
yangtz.cs.liu.campus.domain.student.SchoolStudent
;
import
yangtz.cs.liu.campus.domain.student.SchoolStudentClassRelation
;
import
yangtz.cs.liu.campus.domain.student.SchoolStudentClasses
;
import
yangtz.cs.liu.campus.domain.student.SchoolStudentParent
;
import
yangtz.cs.liu.campus.mapper.schoolCurriculum.SchoolCurriculumMapper
;
import
yangtz.cs.liu.campus.mapper.teacher.SchoolTeacherMapper
;
import
yangtz.cs.liu.campus.service.schoolClass.ISchoolClassHeadmasterService
;
import
yangtz.cs.liu.campus.service.schoolClass.ISchoolClassMentorService
;
import
yangtz.cs.liu.campus.service.schoolClass.ISchoolClassService
;
import
yangtz.cs.liu.campus.service.student.ISchoolStudentClassRelationService
;
import
yangtz.cs.liu.campus.service.student.ISchoolStudentClassesService
;
import
yangtz.cs.liu.campus.service.student.ISchoolStudentParentService
;
import
yangtz.cs.liu.campus.service.student.ISchoolStudentService
;
import
yangtz.cs.liu.dingding.domain.dingDept.SysDdDept
;
import
yangtz.cs.liu.dingding.domain.dingGrade.SchoolGradeMentorCopy
;
import
yangtz.cs.liu.dingding.domain.dingUser.SysDdUser
;
...
...
@@ -18,7 +42,10 @@ import yangtz.cs.liu.dingding.mapper.dingDept.DdDeptMapper;
import
yangtz.cs.liu.dingding.mapper.dingUser.DdUserMapper
;
import
yangtz.cs.liu.dingding.mapper.schoolTeacher.DdTeacherMapper
;
import
yangtz.cs.liu.dingding.service.dingUser.IDdUserService
;
import
yangtz.cs.liu.dingding.utils.AccessTokenUtils
;
import
yangtz.cs.liu.dingding.utils.DingUserUtils
;
import
yangtz.cs.liu.dingding.vo.DingJiaXiaoVo
;
import
yangtz.cs.liu.wechat.utils.AccessTokenUtil
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -26,6 +53,7 @@ import java.util.Map;
@Service
public
class
DdUserServiceImpl
implements
IDdUserService
{
private
static
Logger
log
=
LoggerFactory
.
getLogger
(
DdUserServiceImpl
.
class
);
@Autowired
private
DingUserUtils
dingUserUtils
;
...
...
@@ -35,6 +63,42 @@ public class DdUserServiceImpl implements IDdUserService {
private
DdUserMapper
ddUserMapper
;
@Autowired
private
DdTeacherMapper
ddTeacherMapper
;
//班主任和班级关系
@Autowired
ISchoolClassHeadmasterService
iSchoolClassHeadmasterService
;
@Autowired
private
SchoolTeacherMapper
teacherMapper
;
@Autowired
ISysUserService
sysUserService
;
//学校班级
@Autowired
ISchoolClassService
iSchoolClassService
;
@Autowired
SchoolCurriculumMapper
schoolCurriculumMapper
;
//任课老师和班级关系 ----------------
@Autowired
ISchoolClassMentorService
schoolClassMentorService
;
//学生表 ---------------------
@Autowired
ISchoolStudentService
schoolStudentService
;
//学生与班级关系 --------------------
@Autowired
ISchoolStudentClassRelationService
iSchoolStudentClassRelationService
;
//学生历史班级表 -----------------
@Autowired
ISchoolStudentClassesService
schoolStudentClassesService
;
@Autowired
private
AccessTokenUtils
accessTokenUtils
;
//家长信息表 ---------------------
@Autowired
ISchoolStudentParentService
iSchoolStudentParentService
;
final
String
teacher
=
"teacher"
;
final
String
guardian
=
"guardian"
;
final
String
student
=
"student"
;
/**
* 获取钉钉全部用户id
...
...
@@ -1027,4 +1091,170 @@ public class DdUserServiceImpl implements IDdUserService {
}
return
i
;
}
/**
* 家校通讯录 人员身份新增
*/
public
int
xjUserAdd
(
JSONObject
eventJson
){
String
userId
=
(
String
)
eventJson
.
get
(
"userId"
);
String
role
=
(
String
)
eventJson
.
get
(
"role"
);
String
name
=
(
String
)
eventJson
.
get
(
"name"
);
String
classId
=
(
String
)
eventJson
.
get
(
"classId"
);
JSONObject
feature
=
eventJson
.
getJSONObject
(
"feature"
);
//根据ddclassId 查找班级
Long
l
=
iSchoolClassService
.
selectDdClassId
(
String
.
valueOf
(
classId
));
//判断该当前的角色
if
(
teacher
.
equals
(
role
)){
//老师
// 只在老师角色下意义。 1:班主任 0:非班主任
String
isAdviser
=
(
String
)
feature
.
get
(
"isAdviser"
);
//查询老师表
SchoolTeacher
schoolTeacher
=
teacherMapper
.
selectTeacherByDdUerId
(
userId
);
if
(
null
==
schoolTeacher
){
log
.
warn
(
"新增老师:"
+
name
+
",未在系统中找到不错处理跳过"
);
return
0
;
}
//判断是否是班主任
if
(
"1"
.
equals
(
isAdviser
)){
//班主任
//当前老师是班主任 记录班主任跟班级关系
SchoolClassHeadmaster
schoolClassHeadmaster
=
new
SchoolClassHeadmaster
();
schoolClassHeadmaster
.
setTeacherId
(
schoolTeacher
.
getId
());
schoolClassHeadmaster
.
setClassId
(
l
);
iSchoolClassHeadmasterService
.
save
(
schoolClassHeadmaster
);
//设置班级 班主任信息
SchoolClass
schoolClassss
=
new
SchoolClass
();
schoolClassss
.
setId
(
l
);
schoolClassss
.
setTeacherId
(
schoolTeacher
.
getId
());
schoolClassss
.
setTeacherName
(
schoolTeacher
.
getTeacherName
());
schoolClassss
.
setTeacherTel
(
schoolTeacher
.
getTeacherTel
());
iSchoolClassService
.
updateById
(
schoolClassss
);
}
else
{
//任课老师
//查找部门
SysUser
sysUser
=
sysUserService
.
selectUserById
(
schoolTeacher
.
getId
());
String
deptName
=
sysUser
.
getDept
().
getDeptName
();
//根据部门查找课程信息
SchoolCurriculum
schoolCurriculum
=
schoolCurriculumMapper
.
selectCourseName
(
deptName
);
//任课老师 跟班级关系
SchoolClassMentor
schoolClassMentor
=
new
SchoolClassMentor
();
schoolClassMentor
.
setTeacherId
(
schoolTeacher
.
getId
());
schoolClassMentor
.
setClassId
(
l
);
schoolClassMentor
.
setCourseName
(
schoolCurriculum
.
getCourseName
());
schoolClassMentor
.
setCourseId
(
schoolCurriculum
.
getId
());
schoolClassMentorService
.
save
(
schoolClassMentor
);
}
}
else
if
(
student
.
equals
(
role
)){
//学生
//学生信息
SchoolStudent
schoolStudent
=
new
SchoolStudent
();
schoolStudent
.
setStudentName
(
name
);
schoolStudent
.
setClassId
(
l
);
schoolStudent
.
setStudentStatus
(
"1"
);
schoolStudent
.
setDdUserId
(
userId
);
schoolStudentService
.
save
(
schoolStudent
);
//学生班级信息
SchoolStudentClassRelation
schoolStudentClassRelation
=
new
SchoolStudentClassRelation
();
schoolStudentClassRelation
.
setStudentId
(
schoolStudent
.
getId
());
schoolStudentClassRelation
.
setClassId
(
l
);
iSchoolStudentClassRelationService
.
save
(
schoolStudentClassRelation
);
//学生与班级历史关系
SchoolClass
school
=
iSchoolClassService
.
selectSchoolClassById
(
l
);
SchoolStudentClasses
schoolStudentClasses
=
new
SchoolStudentClasses
();
schoolStudentClasses
.
setStudentId
(
schoolStudent
.
getId
());
schoolStudentClasses
.
setGrade
(
school
.
getGradeName
());
schoolStudentClasses
.
setClasses
(
school
.
getClassName
());
schoolStudentClasses
.
setTeacherName
(
school
.
getTeacherName
());
schoolStudentClassesService
.
save
(
schoolStudentClasses
);
}
else
if
(
guardian
.
equals
(
role
)){
//家长
//找寻学生
String
token
=
accessTokenUtils
.
getToken
();
String
toUserId
=
this
.
getToUserId
(
token
,
userId
,
classId
.
toString
());
Long
ddUserId
=
schoolStudentService
.
getDdUserId
(
toUserId
);
String
tel
=
this
.
getTel
(
userId
,
token
);
//创建用户user表
SysUser
jUser
=
new
SysUser
();
jUser
.
setLoginName
(
name
);
jUser
.
setUserName
(
name
);
jUser
.
setUserType
(
"01"
);
jUser
.
setUserLoginType
(
"1"
);
jUser
.
setPhonenumber
(
this
.
getTel
(
userId
,
token
));
jUser
.
setPassword
(
SecurityUtils
.
encryptPassword
(
"123#@!"
));
jUser
.
setStatus
(
"0"
);
jUser
.
setDelFlag
(
"0"
);
jUser
.
setDdUserId
(
userId
);
jUser
.
setRoleIds
(
new
Long
[]{
111L
});
jUser
.
setStudentId
(
ddUserId
);
sysUserService
.
insertUser
(
jUser
);
//家长表
SchoolStudentParent
schoolStudentParent
=
new
SchoolStudentParent
()
;
schoolStudentParent
.
setStudentId
(
ddUserId
);
schoolStudentParent
.
setUserId
(
jUser
.
getUserId
());
schoolStudentParent
.
setParentName
(
name
);
schoolStudentParent
.
setTelephone
(
tel
);
Integer
patriarch
=
this
.
getPatriarch
(
name
.
substring
(
name
.
length
()
-
2
));
schoolStudentParent
.
setRelationship
(
String
.
valueOf
(
patriarch
));
iSchoolStudentParentService
.
save
(
schoolStudentParent
);
}
return
0
;
}
public
String
getToUserId
(
String
token
,
String
fromUserId
,
String
classId
){
String
toUserId
=
null
;
com
.
alibaba
.
fastjson2
.
JSONObject
bjParme
=
new
com
.
alibaba
.
fastjson2
.
JSONObject
();
bjParme
.
put
(
"from_userid"
,
fromUserId
);
bjParme
.
put
(
"class_id"
,
classId
);
String
bjPost
=
HttpUtil
.
post
(
"https://oapi.dingtalk.com/topapi/edu/user/relation/get?access_token="
+
token
,
bjParme
);
com
.
alibaba
.
fastjson2
.
JSONObject
bjObject
=
com
.
alibaba
.
fastjson2
.
JSONObject
.
parseObject
(
bjPost
);
if
((
Integer
)
bjObject
.
get
(
"errcode"
)
!=
0
){
throw
new
RuntimeException
(
"获取学生id失败"
+
bjPost
);
}
JSONArray
jsonArray
=
bjObject
.
getJSONObject
(
"result"
).
getJSONArray
(
"relations"
);
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++){
toUserId
=
jsonArray
.
getJSONObject
(
0
).
get
(
"to_userid"
).
toString
();
}
return
toUserId
;
}
/**
* 调用钉钉公共接口,获取用户手机号
*/
public
String
getTel
(
String
userId
,
String
assToKen
){
com
.
alibaba
.
fastjson2
.
JSONObject
userParme
=
new
com
.
alibaba
.
fastjson2
.
JSONObject
();
userParme
.
put
(
"userid"
,
userId
);
String
userPost
=
HttpUtil
.
post
(
"https://oapi.dingtalk.com/topapi/v2/user/get?access_token="
+
assToKen
,
userParme
);
com
.
alibaba
.
fastjson2
.
JSONObject
jsonObject
=
com
.
alibaba
.
fastjson2
.
JSONObject
.
parseObject
(
userPost
);
if
(
jsonObject
.
getJSONObject
(
"result"
).
get
(
"mobile"
)==
null
){
return
null
;
}
else
{
return
jsonObject
.
getJSONObject
(
"result"
).
get
(
"mobile"
).
toString
();
}
}
private
Integer
getPatriarch
(
String
patriarch
){
Integer
gId
=
null
;
switch
(
patriarch
){
case
"爸爸"
:
return
gId
=
0
;
case
"妈妈"
:
return
gId
=
1
;
case
"爷爷"
:
return
gId
=
2
;
case
"奶奶"
:
return
gId
=
3
;
case
"叔叔"
:
return
gId
=
4
;
case
"姑姑"
:
return
gId
=
5
;
case
"外婆"
:
return
gId
=
6
;
case
"外公"
:
return
gId
=
7
;
case
"哥哥"
:
return
gId
=
8
;
case
"姐姐"
:
return
gId
=
9
;
case
"阿姨"
:
return
gId
=
10
;
case
"家长"
:
return
gId
=
11
;
}
return
gId
;
}
}
smart-campus/src/main/java/yangtz/cs/liu/wechat/controller/experiment/ExperimentLevelController.java
View file @
7032986b
...
...
@@ -4,15 +4,21 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.common.enums.BusinessType
;
import
java.util.Calendar
;
import
java.util.List
;
import
com.ruoyi.system.service.ISysDeptService
;
import
com.ruoyi.system.service.ISysUserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear
;
import
yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply
;
import
yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply
;
import
yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade
;
import
yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherLabApplyMapper
;
import
yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService
;
import
yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService
;
...
...
@@ -44,9 +50,13 @@ public class ExperimentLevelController extends BaseController {
@Autowired
private
ISchoolGradeService
schoolGradeService
;
@Autowired
private
IS
choolGradeService
grade
Service
;
private
IS
ysUserService
user
Service
;
@Autowired
private
ISysDeptService
deptService
;
/**
* 获取当前学年+学期
*/
...
...
@@ -112,8 +122,10 @@ public class ExperimentLevelController extends BaseController {
@GetMapping
(
"/getGrades"
)
public
AjaxResult
getGrade
(
SchoolLabClassYearVo
schoolLabClassYearVo
)
{
//获取最新学年
int
schoolYear
=
gradeService
.
isNewSchoolYear
();
return
AjaxResult
.
success
(
schoolExperimentPlanService
.
getGrade
(
schoolYear
,
schoolLabClassYearVo
.
getUserId
()));
int
schoolYear
=
schoolGradeService
.
isNewSchoolYear
();
//获取学年分组信息
List
<
String
>
strings
=
schoolGradeService
.
selectSchoolYearGruoUp
();
return
AjaxResult
.
success
(
strings
);
}
/**
...
...
@@ -218,6 +230,19 @@ public class ExperimentLevelController extends BaseController {
*/
@GetMapping
(
"/getGrade/{userId}"
)
public
AjaxResult
getGrade
(
@PathVariable
(
"userId"
)
Long
userId
)
{
return
AjaxResult
.
success
(
schoolGradeService
.
getGradeId
(
userId
));
Long
gradeId
=
null
;
SysUser
sysUser
=
userService
.
selectUserById
(
userId
);
String
ancestors
=
sysUser
.
getDept
().
getAncestors
();
if
(
ancestors
.
length
()!=
2
){
String
[]
split
=
ancestors
.
split
(
","
);
SysDept
sysDept
=
deptService
.
selectDeptById
(
Long
.
valueOf
(
split
[
2
]));
//根据级部名称去查询id
SchoolGrade
schoolGrade
=
schoolGradeService
.
selectGradeByName
(
sysDept
.
getDeptName
());
gradeId
=
schoolGrade
.
getId
();
}
else
{
return
AjaxResult
.
success
(
"当前老师不在级部内"
);
}
return
AjaxResult
.
success
(
gradeId
);
}
}
smart-campus/src/main/java/yangtz/cs/liu/wechat/controller/leave/WxTeacherLeaveController.java
View file @
7032986b
...
...
@@ -30,6 +30,7 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
yangtz.cs.liu.activiti.domain.HistoricActivity
;
import
yangtz.cs.liu.activiti.service.IProcessService
;
import
yangtz.cs.liu.campus.controller.A
;
import
yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade
;
import
yangtz.cs.liu.campus.domain.student.SchoolStudentLeave
;
import
yangtz.cs.liu.campus.domain.teacher.SchoolTeacherLeave
;
...
...
@@ -174,8 +175,6 @@ public class WxTeacherLeaveController extends BaseController {
schoolTeacherLeave
.
setApplyUserId
(
schoolTeacherLeave
.
getTeacherId
());
schoolTeacherLeave
.
setApplyUser
(
schoolTeacherLeave
.
getTeacherName
());
//获取当前用户是教工还是职工
SysUser
user
=
userService
.
selectUserById
(
schoolTeacherLeave
.
getTeacherId
());
schoolTeacherLeave
.
setApplyType
(
user
.
getEmployeeType
());
schoolTeacherLeaveService
.
judgeDate
(
schoolTeacherLeave
);
return
toAjax
(
schoolTeacherLeaveService
.
save
(
schoolTeacherLeave
));
}
...
...
@@ -189,8 +188,7 @@ public class WxTeacherLeaveController extends BaseController {
schoolTeacherLeave
.
setApplyUserId
(
schoolTeacherLeave
.
getTeacherId
());
schoolTeacherLeave
.
setApplyUser
(
schoolTeacherLeave
.
getTeacherName
());
//获取当前用户是教工还是职工
SysUser
user
=
userService
.
selectUserById
(
schoolTeacherLeave
.
getTeacherId
());
schoolTeacherLeave
.
setApplyType
(
user
.
getEmployeeType
());
schoolTeacherLeave
.
setApplyType
(
schoolTeacherLeave
.
getApplyType
());
schoolTeacherLeaveService
.
judgeDate
(
schoolTeacherLeave
);
schoolTeacherLeaveService
.
save
(
schoolTeacherLeave
);
AjaxResult
ajax
=
submission
(
schoolTeacherLeave
.
getId
());
...
...
@@ -435,6 +433,112 @@ public class WxTeacherLeaveController extends BaseController {
//职工
return
AjaxResult
.
success
(
deptService
.
selectDeptTreeList
(
new
SysDept
()));
}
/**
* 根据当前用户找到其所在的组织
*/
@GetMapping
(
"/getUserDept/{userId}"
)
public
AjaxResult
getUserDept
(
@PathVariable
(
"userId"
)
Long
userId
){
List
<
Map
<
String
,
Object
>>
userDeptDate
=
new
ArrayList
<>();
//找到个人所在的所有部门
List
<
Map
<
String
,
Object
>>
maps
=
deptService
.
selectDeptGroupByUserId
(
userId
);
//拼接所有上级部门
for
(
Map
date
:
maps
){
Long
parentId
=
null
;
Long
deptId
=
null
;
Map
map
=
new
HashMap
<>();
StringBuffer
sb
=
new
StringBuffer
();
Long
deptIds
=
(
Long
)
date
.
get
(
"deptId"
);
String
deptName
=
(
String
)
date
.
get
(
"deptName"
);
deptId
=
(
Long
)
date
.
get
(
"parentId"
);
sb
.
append
(
deptName
);
Boolean
flag
=
true
;
// 查找上级
do
{
//获取父级部门
SysDept
sysDept
=
deptService
.
selectDeptById
(
deptId
);
if
(
null
!=
sysDept
){
flag
=
true
;
//往前拼接部门名称
sb
.
insert
(
0
,
sysDept
.
getDeptName
()+
"/"
);
deptId
=
sysDept
.
getParentId
();
}
else
{
flag
=
false
;
}
}
while
(
flag
);
//截取掉第一个部门
String
deptNameGroup
=
sb
.
toString
();
//部门
String
substring
=
deptNameGroup
.
substring
(
deptNameGroup
.
indexOf
(
"/"
)
+
1
);
map
.
put
(
"deptName"
,
substring
);
map
.
put
(
"deptId"
,
deptIds
);
userDeptDate
.
add
(
map
);
}
return
AjaxResult
.
success
(
userDeptDate
);
}
/**
* 查找 当前部门级部主任
*/
@GetMapping
(
"/getDeptGrapRole"
)
public
AjaxResult
getDeptGrapRole
(
SysDept
dept
){
String
deptName
=
dept
.
getDeptName
();
Long
deptId
=
dept
.
getDeptId
();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
//判断当前部门
if
(
deptName
.
contains
(
"级部"
)){
//教工
map
.
put
(
"employeeType"
,
"0"
)
;
//查找当前的级部
String
substring
=
deptName
.
substring
(
0
,
deptName
.
indexOf
(
"/"
));
SysDept
sysDept
=
new
SysDept
();
sysDept
.
setDeptName
(
substring
);
List
<
SysDept
>
sysDepts
=
deptService
.
selectDept
(
sysDept
);
//级部信息
SysDept
njgroup
=
sysDepts
.
get
(
0
);
//查找当前级部的角色
List
<
String
>
strings
=
userService
.
selectDeptRoleBydeptId
(
njgroup
.
getDeptId
().
toString
());
StringBuffer
sb
=
new
StringBuffer
();
String
substring1
=
""
;
for
(
String
st
:
strings
){
sb
.
append
(
st
);
sb
.
append
(
","
);
}
if
(!
StringUtils
.
isEmpty
(
sb
.
toString
())){
substring1
=
sb
.
substring
(
0
,
sb
.
length
()
-
1
);
}
map
.
put
(
"userName"
,
substring1
);
}
else
{
//职工
map
.
put
(
"employeeType"
,
"1"
)
;
//从根部查找第三级 查找办公室主任
SysDept
sysDept
=
new
SysDept
();
sysDept
.
setDeptId
(
deptId
);
List
<
SysDept
>
sysDepts
=
deptService
.
selectDept
(
sysDept
);
SysDept
kesDate
=
sysDepts
.
get
(
0
);
//获取父级信息
String
ancestors
=
kesDate
.
getAncestors
();
String
[]
split
=
ancestors
.
split
(
","
);
//取到三级id
String
daptParmId
=
split
[
2
];
SysDept
sysDept1
=
deptService
.
selectDeptById
(
Long
.
valueOf
(
daptParmId
));
//查找科室主任
List
<
String
>
strings
=
userService
.
selectDeptPlaceBydeptId
(
sysDept1
.
getDeptId
().
toString
());
StringBuffer
stringBuffer
=
new
StringBuffer
();
String
substring
=
""
;
for
(
String
date
:
strings
){
stringBuffer
.
append
(
date
);
stringBuffer
.
append
(
","
);
}
if
(!
StringUtils
.
isEmpty
(
stringBuffer
.
toString
())){
String
nameStr
=
stringBuffer
.
toString
();
substring
=
nameStr
.
substring
(
0
,
nameStr
.
length
()
-
1
);
}
map
.
put
(
"userName"
,
substring
)
;
}
return
AjaxResult
.
success
(
map
);
}
/**
* 获取当前登录人所在部门或级部
...
...
@@ -478,12 +582,12 @@ public class WxTeacherLeaveController extends BaseController {
* 教工传参,请假开始日期(年月日)及第几节课,结束日期及第几节课
* 职工传参,请假开始时间,结束时间(年月日 时分秒)
*/
@GetMapping
(
"/getTotalTime/{userId}"
)
public
AjaxResult
getTotalTime
(
@PathVariable
Long
userId
,
SchoolTeacherLeave
schoolTeacherLeave
)
{
@GetMapping
(
"/getTotalTime/{userId}
/{employeeType}
"
)
public
AjaxResult
getTotalTime
(
@PathVariable
(
"userId"
)
Long
userId
,
@PathVariable
(
"employeeType"
)
String
employeeTypes
,
SchoolTeacherLeave
schoolTeacherLeave
)
{
AjaxResult
ajax
=
AjaxResult
.
success
();
double
day
=
0.0
;
//判断用户是职工还是教工
String
employeeType
=
userService
.
selectUserById
(
userId
).
getEmployeeType
()
;
String
employeeType
=
employeeTypes
;
schoolTeacherLeave
.
setApplyType
(
employeeType
);
schoolTeacherLeaveService
.
judgeDate
(
schoolTeacherLeave
);
//获取周末,节假日日期
...
...
smart-campus/src/main/resources/mapper/schoolClass/SchoolClassMapper.xml
View file @
7032986b
...
...
@@ -160,8 +160,13 @@
</select>
<select
id=
"selectDdClassId"
resultType=
"java.lang.Long"
>
select sg.id from school_class
_copy
sg
select sg.id from school_class sg
where sg.del_flag = '0' and sg.dd_class_id=#{ddClssId}
</select>
<select
id=
"selectTeacherByTeachId"
resultType=
"yangtz.cs.liu.wechat.vo.schoolClass.SchoolClassVo"
>
select * from school_class
where del_flag = '0' and teacher_id = #{teachId}
</select>
</mapper>
smart-campus/src/main/resources/mapper/schoolgrade/SchoolGradeMapper.xml
View file @
7032986b
...
...
@@ -50,6 +50,14 @@
select max(school_year) nowYear from school_grade where del_flag = '0'
</select>
<select
id=
"selectGradeByName"
resultType=
"yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade"
>
select * from school_grade g where del_flag = '0' and g.grade_name = #{name}
</select>
<select
id=
"selectNowSchoolGrade"
resultType=
"yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade"
>
<include
refid=
"selectSchoolGradeVo"
/>
where school_year = (select max(school_year) from school_grade )
...
...
smart-campus/src/main/resources/mapper/teacher/SchoolTeacherMapper.xml
View file @
7032986b
...
...
@@ -286,6 +286,12 @@
where id_card = #{idCard} and del_flag = '0'
</select>
<select
id=
"selectTeacherByDdUerId"
resultType=
"com.ruoyi.common.core.domain.entity.SchoolTeacher"
>
<include
refid=
"selectSchoolTeacherVo"
/>
where dd_user_id = #{dduserId} and del_flag = '0'
</select>
<select
id=
"selectUserByTeacherName"
resultType=
"com.ruoyi.common.core.domain.entity.SchoolTeacher"
>
<include
refid=
"selectSchoolTeacherVo"
/>
where teacher_name = #{teacherName} and del_flag = '0'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment