Commit 55c32ca8 by Cat
parents d3d838cb 05b3eb2d
No preview for this file type
...@@ -201,17 +201,36 @@ wx: ...@@ -201,17 +201,36 @@ wx:
# redirect-uri: y32025c600.goho.co:10087 # redirect-uri: y32025c600.goho.co:10087
dd: dd:
# 本地配置
appKey: dingclpf8qoxvinhksyh appKey: dingclpf8qoxvinhksyh
appSecret: CrlRmzkaFMH00cbipSf3g0nc_xpFGCitTAPA_cphUXg1e-DSX1hFcyVpqgos29r9 appSecret: CrlRmzkaFMH00cbipSf3g0nc_xpFGCitTAPA_cphUXg1e-DSX1hFcyVpqgos29r9
# 钉钉接口 获取钉钉access_token 的uri # 钉钉接口 获取钉钉access_token 的uri
access-token-uri: https://oapi.dingtalk.com/gettoken?appkey=${dd.appKey}&appsecret=${dd.appSecret} access-token-uri: https://oapi.dingtalk.com/gettoken?appkey=${dd.appKey}&appsecret=${dd.appSecret}
#企业id #企业id
corpId: dingaa3937ff8b7dd267f2c783f7214b6d69 corpId: dingaa3937ff8b7dd267f2c783f7214b6d69
#应用id #应用id
agentId: 2730043705 agentId: 2730043705
# 测试服务器配置
# appKey: ding5cbf7qhd55zun5jg
# appSecret: -er7LnIslFEJ2n8cJY9MdTCKiRDjoCZwQuA2XvU2Hr7fHw-cp_B2ZAhynVifqlL8
# # 钉钉接口 获取钉钉access_token 的uri
# access-token-uri: https://oapi.dingtalk.com/gettoken?appkey=${dd.appKey}&appsecret=${dd.appSecret}
# #企业id
# corpId: dingaa3937ff8b7dd267f2c783f7214b6d69
# #应用id
# agentId: 2760774127
# 正式配置
# appKey: dingggqchzyvxm9e6e7v
# appSecret: ts5hRNjO_o3QNMfEu4pM2dn71YJzw7yalnuh5LztHuCGWqUNjM2lMB1eNCSOlxNN
# # 钉钉接口 获取钉钉access_token 的uri
# access-token-uri: https://oapi.dingtalk.com/gettoken?appkey=${dd.appKey}&appsecret=${dd.appSecret}
# #企业id
# corpId: dingccea40788226c988f2c783f7214b6d69
# #应用id
# agentId: 2765311628
#重定向地址 #重定向地址
redirect-uri: www.dyzmxx.com redirect-uri: www.dyzmxx.com
......
...@@ -132,6 +132,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter ...@@ -132,6 +132,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers("/wx/user/getToken").permitAll() .antMatchers("/wx/user/getToken").permitAll()
//钉钉免登录接口 //钉钉免登录接口
.antMatchers("/dd/App/user/**").permitAll() .antMatchers("/dd/App/user/**").permitAll()
.antMatchers("/dd/djtx/**").permitAll()
//开发一个接口字典 //开发一个接口字典
.antMatchers("/system/dict/data/type/**").permitAll() .antMatchers("/system/dict/data/type/**").permitAll()
// .antMatchers("/**").permitAll() // .antMatchers("/**").permitAll()
......
...@@ -27,6 +27,7 @@ public interface ISysRoleService ...@@ -27,6 +27,7 @@ public interface ISysRoleService
* @return 角色列表 * @return 角色列表
*/ */
public List<SysRole> selectRolesByUserId(Long userId); public List<SysRole> selectRolesByUserId(Long userId);
public List<SysRole> selectRolesByUserIdDdApp(Long userId);
/** /**
* 根据用户ID查询角色权限 * 根据用户ID查询角色权限
......
...@@ -83,6 +83,25 @@ public class SysRoleServiceImpl implements ISysRoleService ...@@ -83,6 +83,25 @@ public class SysRoleServiceImpl implements ISysRoleService
return roles; return roles;
} }
public List<SysRole> selectRolesByUserIdDdApp(Long userId)
{
List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
List<SysRole> roles = roleMapper.selectRoleList(new SysRole());
for (SysRole role : roles)
{
for (SysRole userRole : userRoles)
{
if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
{
role.setFlag(true);
break;
}
}
}
return roles;
}
/** /**
* 根据用户ID查询权限 * 根据用户ID查询权限
* *
......
...@@ -7,7 +7,7 @@ git clone https://gitee.com/y_project/RuoYi-Vue ...@@ -7,7 +7,7 @@ git clone https://gitee.com/y_project/RuoYi-Vue
# 进入项目目录 # 进入项目目录
cd ruoyi-ui cd ruoyi-ui
__
# 安装依赖 # 安装依赖
npm install npm install
......
...@@ -8,7 +8,14 @@ import { isRelogin } from "@/utils/request"; ...@@ -8,7 +8,14 @@ import { isRelogin } from "@/utils/request";
NProgress.configure({ showSpinner: false }); NProgress.configure({ showSpinner: false });
const whiteList = ["/login", "/auth-redirect", "/bind", "/register", "/index"]; const whiteList = [
"/login",
"/auth-redirect",
"/bind",
"/register",
"/index",
"/dd",
];
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
NProgress.start(); NProgress.start();
......
...@@ -501,10 +501,7 @@ export default { ...@@ -501,10 +501,7 @@ export default {
} }
}, },
created() { created() {
// 钉钉code码,正式时打开 this.init()
// this.getCode()
// token,测试用
this.csToken()
}, },
mounted() { mounted() {
...@@ -529,59 +526,7 @@ export default { ...@@ -529,59 +526,7 @@ export default {
}, },
methods: { methods: {
// 获取code
getCode() {
dd.getAuthCode({
corpId: 'dingaa3937ff8b7dd267f2c783f7214b6d69',
success: (res) => {
console.log('获取新的免登码成功', res);
const code = res.code
// this.code = code;
// this.authCodeTimestamp = currentTime;
// console.log('this.authCodeTimestamp', this.authCodeTimestamp);
console.log('code', code);
this.getToken(code)
// console.log('loginResponse', loginResponse);
},
fail: (res) => {
console.log('获取免登码失败', res);
},
complete: () => { },
});
},
// 获取token
getToken(code) {
getCode(code).then(res => {
console.log('res', res.token);
if (res.token) {
setToken(res.token)
this.$store.commit('SET_TOKEN', res.token)
// this.$router.push({ path: '/index' });
// 判断当前用户是否已拉取完user_info信息
this.$store.dispatch('GetInfo').then((res) => {
this.$store.dispatch('GenerateRoutes').then(accessRoutes => {
// 根据roles权限生成可访问的路由表
router.addRoutes(accessRoutes) // 动态添加可访问路由表
this.init()
})
})
} else {
this.$message.error(res.message)
}
})
},
// 测试token
csToken() {
if (getToken()) {
console.log('getToken', getToken());
this.init()
} else {
this.$router.push({ path: '/login' });
}
},
//从后端获取任务数量 //从后端获取任务数量
taskNum() { taskNum() {
......
...@@ -20,7 +20,11 @@ ...@@ -20,7 +20,11 @@
<el-table stripe :data="tableData" border style="width: 98%"> <el-table stripe :data="tableData" border style="width: 98%">
<el-table-column align="center" type="index" label="序号" width="55" /> <el-table-column align="center" type="index" label="序号" width="55" />
<el-table-column align="center" prop="borrowBy" label="申请人" /> <el-table-column align="center" prop="borrowBy" label="申请人" />
<el-table-column align="center" prop="borrowState" label="借用状态" /> <el-table-column align="center" prop="borrowState" label="借用状态">
<template slot-scope="{ row }">
<div>{{ selectDictLabel(dict.type.borrow_state, row.borrowState) }}</div>
</template>
</el-table-column>
<el-table-column align="center" prop="schoolTeacherBorrowDetailList" label="借用明细"> <el-table-column align="center" prop="schoolTeacherBorrowDetailList" label="借用明细">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<div v-for="detail in row.schoolTeacherBorrowDetailList" :key="detail.id"> <div v-for="detail in row.schoolTeacherBorrowDetailList" :key="detail.id">
...@@ -34,10 +38,14 @@ ...@@ -34,10 +38,14 @@
<el-table-column align="center" prop="remark" label="备注" /> <el-table-column align="center" prop="remark" label="备注" />
<el-table-column align="center" fixed="right" label="操作"> <el-table-column align="center" fixed="right" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="handleLook(scope.row)" type="text" size="small">详情</el-button> <el-button v-if="scope.row.borrowState === '0' || scope.row.borrowState === '1'"
<el-button @click="processItem(scope.row)" type="text" size="small">借用</el-button> @click="handleLook(scope.row)" type="text" size="small">详情</el-button>
<el-button @click="returnItem(scope.row)" type="text" size="small">归还</el-button> <el-button v-if="scope.row.borrowState === '0'" @click="returnItem(scope.row)" type="text"
size="small">归还</el-button>
<el-button v-if="scope.row.borrowState === '2'" @click="processItem(scope.row)" type="text"
size="small">借用</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -203,6 +211,7 @@ import { ...@@ -203,6 +211,7 @@ import {
} from '@/api/smartSchool/InstrumentDrugAdministration/instrumentBorrowManagement/warehouseEquipmentLoan' } from '@/api/smartSchool/InstrumentDrugAdministration/instrumentBorrowManagement/warehouseEquipmentLoan'
export default { export default {
name: 'warehouseEquipmentLoan', name: 'warehouseEquipmentLoan',
dicts: ['borrow_state'],
data() { data() {
return { return {
queryForm: { queryForm: {
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
</el-col> </el-col>
</el-row> </el-row>
<!-- 表格 --> <!-- 表格 -->
<el-table :data="tableData" v-loading="loading" row-key="id" :default-expand-all="isExpandAll" <el-table :data="tableData" v-loading="loading" row-key="id" :default-expand-all="isExpandAll"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
...@@ -43,7 +41,6 @@ ...@@ -43,7 +41,6 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 弹窗 --> <!-- 弹窗 -->
<el-dialog :title="title" :visible.sync="dialogTableVisible" width="30%" show-close> <el-dialog :title="title" :visible.sync="dialogTableVisible" width="30%" show-close>
<el-form :model="form" ref="form" size="small" :rules="rules" label-width="108px"> <el-form :model="form" ref="form" size="small" :rules="rules" label-width="108px">
...@@ -77,7 +74,6 @@ ...@@ -77,7 +74,6 @@
<el-radio label='1'></el-radio> <el-radio label='1'></el-radio>
<el-radio label='0'></el-radio> <el-radio label='0'></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -89,13 +85,11 @@ ...@@ -89,13 +85,11 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button type="primary" @click="submitparentForm">确定</el-button> <el-button type="primary" @click="submitparentForm">确定</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 分页 --> <!-- 分页 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryForm.pageNum" :limit.sync="queryForm.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryForm.pageNum" :limit.sync="queryForm.pageSize"
@pagination="getList" /> @pagination="getList" />
...@@ -120,20 +114,18 @@ export default { ...@@ -120,20 +114,18 @@ export default {
queryForm: { queryForm: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
instrumentTypeName: "", instrumentTypeName: null,
id: "", id: null,
}, },
selectedRows: [], // 用于存储选择的行数据 selectedRows: [], // 用于存储选择的行数据
//表格数据 //表格数据
tableData: [ tableData: [ ],
],
nowType: 0, // 0新增、1编辑、2查看 nowType: 0, // 0新增、1编辑、2查看
title: '', title: '',
// 弹窗 // 弹窗
form: { form: {
instrumentTypeName: "", instrumentTypeName: null,
parentId: "", parentId: null,
orderNum: "", orderNum: "",
isConsumables: "", isConsumables: "",
remark: "", remark: "",
...@@ -178,6 +170,7 @@ export default { ...@@ -178,6 +170,7 @@ export default {
this.loading = false; this.loading = false;
}) })
}, },
normalizer(node) { normalizer(node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children; delete node.children;
...@@ -193,8 +186,8 @@ export default { ...@@ -193,8 +186,8 @@ export default {
this.queryForm = { this.queryForm = {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
instrumentTypeName: "", instrumentTypeName: null,
id: "", id: null,
}, },
this.getList(); this.getList();
}, },
...@@ -203,8 +196,8 @@ export default { ...@@ -203,8 +196,8 @@ export default {
handleOption(type, item) { handleOption(type, item) {
this.form = { this.form = {
id: '', id: '',
instrumentTypeName: "", instrumentTypeName: null,
parentId: "", parentId: null,
orderNum: "", orderNum: "",
isConsumables: "", isConsumables: "",
remark: "", remark: "",
...@@ -217,6 +210,7 @@ export default { ...@@ -217,6 +210,7 @@ export default {
Object.keys(this.form).forEach(key => { Object.keys(this.form).forEach(key => {
if (res.data[key]) { if (res.data[key]) {
this.$set(this.form, key, res.data[key]); this.$set(this.form, key, res.data[key]);
} }
}); });
} }
...@@ -266,7 +260,7 @@ export default { ...@@ -266,7 +260,7 @@ export default {
// 这里需要重置对话框表单 // 这里需要重置对话框表单
this.form = { this.form = {
instrumentTypeName: "", instrumentTypeName: "",
parentId: "", parentId: null,
orderNum: "", orderNum: "",
isConsumables: "", isConsumables: "",
remark: "", remark: "",
......
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
instrumentName: "", instrumentName: "",
instrumentTypeId: "", instrumentTypeId: null,
daterange: "", daterange: "",
startTime: "", startTime: "",
endTime: "", endTime: "",
...@@ -99,6 +99,8 @@ export default { ...@@ -99,6 +99,8 @@ export default {
}, },
/** 转换分类编码数据结构 */ /** 转换分类编码数据结构 */
normalizer(node) { normalizer(node) {
console.log('queryForm.instrumentTypeId', this.queryForm.instrumentTypeId);
console.log('node', node);
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children; delete node.children;
} }
...@@ -114,7 +116,7 @@ export default { ...@@ -114,7 +116,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
instrumentName: "", instrumentName: "",
instrumentTypeId: "", instrumentTypeId: null,
startTime: "", startTime: "",
endTime: "", endTime: "",
}, },
......
...@@ -177,7 +177,7 @@ export default { ...@@ -177,7 +177,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
instrumentName: "", instrumentName: "",
instrumentTypeId: "", instrumentTypeId: null,
}, },
//表格数据 //表格数据
tableData: [ tableData: [
...@@ -199,7 +199,7 @@ export default { ...@@ -199,7 +199,7 @@ export default {
form: { form: {
instrumentName: "", instrumentName: "",
instrumentTypeId: "", instrumentTypeId: "",
instrumentTypeName: "", instrumentTypeName: null,
instrumentModel: "", instrumentModel: "",
instrumentNum: "", instrumentNum: "",
remark: "", remark: "",
...@@ -289,7 +289,7 @@ export default { ...@@ -289,7 +289,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
instrumentName: "", instrumentName: "",
instrumentTypeId: "", instrumentTypeId: null,
}, },
this.getList(); this.getList();
}, },
...@@ -300,7 +300,7 @@ export default { ...@@ -300,7 +300,7 @@ export default {
id: '', id: '',
instrumentName: "", instrumentName: "",
instrumentTypeId: "", instrumentTypeId: "",
instrumentTypeName: "", instrumentTypeName: null,
instrumentModel: "", instrumentModel: "",
instrumentNum: "", instrumentNum: "",
remark: "", remark: "",
...@@ -426,7 +426,7 @@ export default { ...@@ -426,7 +426,7 @@ export default {
this.form = { this.form = {
id: null, id: null,
instrumentName: null, instrumentName: null,
instrumentTypeId: null, instrumentTypeId: '',
instrumentTypeName: null, instrumentTypeName: null,
instrumentModel: null, instrumentModel: null,
instrumentNum: null, instrumentNum: null,
......
...@@ -361,8 +361,6 @@ export default { ...@@ -361,8 +361,6 @@ export default {
} else { } else {
this.postForm.accessoryUrl = ''; this.postForm.accessoryUrl = '';
this.postForm.accessoryName = ''; this.postForm.accessoryName = '';
} }
}, },
......
...@@ -339,7 +339,6 @@ export default { ...@@ -339,7 +339,6 @@ export default {
console.log('response', response); console.log('response', response);
this.loading = false; this.loading = false;
this.getClasslist(); this.getClasslist();
this.dialogTableVisible = true; this.dialogTableVisible = true;
}); });
}, },
......
...@@ -406,18 +406,17 @@ export default { ...@@ -406,18 +406,17 @@ export default {
methods: { methods: {
getList() { getList() {
getApplylist(this.queryForm) getApplylist(this.queryForm).then(response => {
.then(response => { this.tableData = response.rows;
this.tableData = response.rows; this.tableData = response.rows.map(item => {
this.tableData = response.rows.map(item => { item.accessoryList = item.schoolAccessoryList; // 将附件信息赋值给accessoryList属性
item.accessoryList = item.schoolAccessoryList; // 将附件信息赋值给accessoryList属性 return item;
return item; });
}); console.log('response', response);
console.log('response', response); console.log(response.rows.a);
console.log(response.rows.a); this.total = response.total;
this.total = response.total; this.loading = false;
this.loading = false; })
})
.catch(error => { .catch(error => {
this.loading = false; this.loading = false;
console.log(error); console.log(error);
...@@ -519,6 +518,7 @@ export default { ...@@ -519,6 +518,7 @@ export default {
}, },
//上传按钮 //上传按钮
getFileList(data) { getFileList(data) {
console.log('data', data); console.log('data', data);
...@@ -527,6 +527,8 @@ export default { ...@@ -527,6 +527,8 @@ export default {
if (this.fileList.length != 0) { if (this.fileList.length != 0) {
this.postForm.accessoryUrl = data[0].fjlj; this.postForm.accessoryUrl = data[0].fjlj;
this.postForm.accessoryName = data[0].fjmc; this.postForm.accessoryName = data[0].fjmc;
console.log(this.postForm.accessoryName);
console.log(this.postForm.accessoryUrl);
console.log('this.postForm', this.postForm); console.log('this.postForm', this.postForm);
} else { } else {
this.postForm.accessoryUrl = ''; this.postForm.accessoryUrl = '';
...@@ -724,6 +726,4 @@ export default { ...@@ -724,6 +726,4 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
<el-row :gutter="30"> <el-row :gutter="30">
<el-col :span="10"> <el-col :span="10">
<el-form-item label="申请老师"> <el-form-item label="申请老师">
<el-input v-model="postForm.applyName" placeholder="请输入" clearable :disabled="isEdit"/> <el-input v-model="postForm.applyName" placeholder="请输入" clearable :disabled="isEdit" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
...@@ -187,12 +187,13 @@ ...@@ -187,12 +187,13 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="10"> <el-col :span="10">
<el-form-item label="实验名称"> <el-form-item label="实验名称">
<el-input v-model="postForm.experimentName" placeholder="请输入" clearable :disabled="isEdit"/> <el-input v-model="postForm.experimentName" placeholder="请输入" clearable :disabled="isEdit" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="学科"> <el-form-item label="学科">
<el-select v-model="postForm.sub" placeholder="请选择" clearable style="width: 100%;" :disabled="isEdit"> <el-select v-model="postForm.sub" placeholder="请选择" clearable style="width: 100%;"
:disabled="isEdit">
<el-option v-for="dict in dict.type.lab_sub" :key="dict.value" :label="dict.label" <el-option v-for="dict in dict.type.lab_sub" :key="dict.value" :label="dict.label"
:value="dict.value" /> :value="dict.value" />
</el-select> </el-select>
...@@ -204,7 +205,8 @@ ...@@ -204,7 +205,8 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="20"> <el-col :span="20">
<el-form-item label="章节内容"> <el-form-item label="章节内容">
<el-input v-model="postForm.chapterContent" placeholder="请输入" clearable :disabled="isEdit"></el-input> <el-input v-model="postForm.chapterContent" placeholder="请输入" clearable
:disabled="isEdit"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -213,12 +215,12 @@ ...@@ -213,12 +215,12 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="10"> <el-col :span="10">
<el-form-item label="级部"> <el-form-item label="级部">
<el-input v-model="postForm.grade" placeholder="请输入" clearable :disabled="isEdit"/> <el-input v-model="postForm.grade" placeholder="请输入" clearable :disabled="isEdit" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="学年"> <el-form-item label="学年">
<el-input v-model="postForm.schoolYear" placeholder="请输入" clearable :disabled="isEdit"/> <el-input v-model="postForm.schoolYear" placeholder="请输入" clearable :disabled="isEdit" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleOption(0)">新增</el-button> <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleOption(0)">新增</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table border v-loading="loading" :data="competitionData" stripe> <el-table border v-loading="loading" :data="competitionData" stripe>
<el-table-column fixed="left" label="序号" type="index" width="55" align="center" /> <el-table-column fixed="left" label="序号" type="index" width="55" align="center" />
...@@ -43,7 +42,6 @@ ...@@ -43,7 +42,6 @@
:preview-src-list="scope.row.previewUrls"></el-image> :preview-src-list="scope.row.previewUrls"></el-image>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注1" align="center" prop="remark1" /> <el-table-column label="备注1" align="center" prop="remark1" />
<el-table-column label="备注2" align="center" prop="remark2" /> <el-table-column label="备注2" align="center" prop="remark2" />
<el-table-column label="备注3" align="center" prop="remark3" /> <el-table-column label="备注3" align="center" prop="remark3" />
...@@ -57,19 +55,18 @@ ...@@ -57,19 +55,18 @@
</el-table> </el-table>
<pagination ref="pageBlock" v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" <pagination ref="pageBlock" v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" /> :limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 新增、编辑、查看弹窗 --> <!-- 新增、编辑、查看弹窗 -->
<el-dialog title="详细信息" :visible.sync="dialogVisible" width="50%"> <el-dialog title="详细信息" :visible.sync="dialogVisible" width="50%">
<el-form :model="form" ref="form" size="small" label-width="108px" :disabled="isEdit"> <el-form :model="form" ref="form" size="small" label-width="108px" :disabled="isEdit" :rules="rules">
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="学年"> <el-form-item label="学年" prop="schoolYear">
<el-input v-model="form.schoolYear" placeholder="请输入" clearable <el-input v-model="form.schoolYear" placeholder="请输入" clearable
:disabled="nowType == 2 ? true : false"></el-input> :disabled="nowType == 2 ? true : false"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="参赛老师"> <el-form-item label="参赛老师" prop="teacherName">
<el-select v-model="form.teacherName" placeholder="请选择级部" clearable style="width: 100%;" <el-select v-model="form.teacherName" placeholder="请选择级部" clearable style="width: 100%;"
:disabled="nowType == 2 ? true : false"> :disabled="nowType == 2 ? true : false">
<el-option v-for="(item, index) in teacherList" :key="index" :label="item.userName" <el-option v-for="(item, index) in teacherList" :key="index" :label="item.userName"
...@@ -103,7 +100,7 @@ ...@@ -103,7 +100,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="比赛级别"> <el-form-item label="比赛级别" prop="competitionLevel">
<el-select v-model="form.competitionLevel" placeholder="请选择" clearable style="width: 100%;" <el-select v-model="form.competitionLevel" placeholder="请选择" clearable style="width: 100%;"
:disabled="nowType == 2 ? true : false"> :disabled="nowType == 2 ? true : false">
<el-option v-for="dict in dict.type.competition_level" :key="dict.value" :label="dict.label" <el-option v-for="dict in dict.type.competition_level" :key="dict.value" :label="dict.label"
...@@ -115,14 +112,14 @@ ...@@ -115,14 +112,14 @@
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-form-item prop="schoolAccessoryList" label="证书照片"> <el-form-item prop="schoolAccessoryList" label="证书照片">
<el-upload v-loading="uploadLoading" class="avatar-uploader" action="#" accept="image/*" <el-upload v-loading="uploadLoading" class="avatar-uploader" action="#" accept="image/*"
:show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload" :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload"
:http-request="uploadImage"> :http-request="uploadImage">
<img v-if="form.schoolAccessoryList && form.schoolAccessoryList.length > 0" <img v-if="form.schoolAccessoryList && form.schoolAccessoryList.length > 0"
:src="form.schoolAccessoryList[0].accessoryUrl" class="avatar" /> :src="form.schoolAccessoryList[0].accessoryUrl" class="avatar" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="备注1"> <el-form-item label="备注1">
...@@ -151,14 +148,12 @@ ...@@ -151,14 +148,12 @@
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog ref="previewDialog" title="预览图片" :visible.sync="previewDialogVisible"> <el-dialog ref="previewDialog" title="预览图片" :visible.sync="previewDialogVisible">
<el-image style="width: 100%; max-height: 80vh; object-fit: contain" :src="previewImageUrl" <el-image style="width: 100%; max-height: 80vh; object-fit: contain" :src="previewImageUrl"
fit="contain"></el-image> fit="contain"></el-image>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {
addCompetition, addCompetition,
...@@ -185,6 +180,8 @@ export default { ...@@ -185,6 +180,8 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
competitionType: "",
competitionName: "",
}, },
previewImageUrl: '', previewImageUrl: '',
//获取子组件传来的信息 //获取子组件传来的信息
...@@ -216,6 +213,27 @@ export default { ...@@ -216,6 +213,27 @@ export default {
schoolAccessoryList: [], 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" }
],
},
previewDialogVisible: false, previewDialogVisible: false,
teacherList: [], teacherList: [],
rules: {}, rules: {},
...@@ -242,19 +260,19 @@ export default { ...@@ -242,19 +260,19 @@ export default {
}, },
//获取列表数据 //获取列表数据
getList() { getList() {
getCompetition(this.queryForm).then(response => { getCompetition(this.queryParams).then(response => {
this.competitionData = response.rows; this.competitionData = response.rows.map(item => {
item.previewUrls = item.schoolAccessoryList.map(accessory => accessory.accessoryUrl);
item.pictureUrl = item.schoolAccessoryList[0]?.accessoryUrl || ''; // 取第一个照片的URL或者为空字符串
return item;
});
console.log('response', response); console.log('response', response);
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
this.competitionData.forEach(item => {
item.previewUrls = [item.schoolAccessoryList.map(accessory => accessory.accessoryUrl)];
item.pictureUrl = item.schoolAccessoryList.map(accessory => accessory.accessoryUrl);
});
}); });
}, },
//获取图片信息 //获取图片信息
getSchoolInfoPic(val) { getSchoolInfoPic(val) {
this.pic = val this.pic = val
...@@ -306,7 +324,13 @@ export default { ...@@ -306,7 +324,13 @@ export default {
//重置 //重置
resetQuery() { resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
competitionType: "",
competitionName: "",
},
this.getList();
}, },
...@@ -330,6 +354,7 @@ export default { ...@@ -330,6 +354,7 @@ export default {
//编辑 0新增 1编辑 2查看 //编辑 0新增 1编辑 2查看
handleOption(type, row) { handleOption(type, row) {
this.imageUrl = ''; this.imageUrl = '';
this.form.schoolAccessoryList = [];
this.form = { this.form = {
id: '', id: '',
schoolYear: '', schoolYear: '',
......
<!--社团风采-->
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form
...@@ -62,7 +63,7 @@ ...@@ -62,7 +63,7 @@
<el-table-column label="风采主题" align="center" prop="theme" /> <el-table-column label="风采主题" align="center" prop="theme" />
<el-table-column label="附件" align="center" prop="file"> <el-table-column label="附件" align="center" prop="file">
<template slot-scope="scope"> <template slot-scope="scope">
<el-image style="width: 100px; height: 100px" :src="scope.row.file"> <el-image v-for="(item,index) in scope.row.file.split(',')" :key="index" style="width: 100px; height: 100px" :src="item" :preview-src-list="[item]">
</el-image> </el-image>
</template> </template>
</el-table-column> </el-table-column>
...@@ -137,17 +138,21 @@ ...@@ -137,17 +138,21 @@
" "
> >
<el-upload <el-upload
multiple
v-loading="uploadLoading" v-loading="uploadLoading"
class="avatar-uploader" class="avatar-uploader"
action="#" :action="uploadFileUrl"
accept="image/*" accept="image/*"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
:http-request="uploadImage"
> >
<img v-if="form.file" :src="form.file" class="avatar" /> <!-- <img v-for="(item,index) in form.file" :key="index" v-if="form.file" :src="item" class="avatar" />-->
<div v-if="form.file">
<img v-for="(item,index) in form.file" :key="index" :src="item" class="avatar" />
</div>
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
...@@ -191,6 +196,9 @@ export default { ...@@ -191,6 +196,9 @@ export default {
components: { picAvatar }, components: { picAvatar },
data() { data() {
return { return {
//图片上传列表
uploadList: [],
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
pev: process.env.VUE_APP_BASE_API, pev: process.env.VUE_APP_BASE_API,
// 输入框字数限制 // 输入框字数限制
TEXT_SIZE, TEXT_SIZE,
...@@ -313,10 +321,9 @@ export default { ...@@ -313,10 +321,9 @@ export default {
}; };
// console.log(params); // console.log(params);
getCommunityInfo(params).then((response) => { getCommunityInfo(params).then((response) => {
// console.log("response", response); console.log("response", response);
this.picList = response.rows; this.picList = response.rows;
this.picList.file = response.rows.file; // this.picList.file = response.rows.file.split(',');
// console.log(this.picList.file);
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
...@@ -369,8 +376,10 @@ export default { ...@@ -369,8 +376,10 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.uploadList = []
this.check = false; this.check = false;
this.reset(); this.reset();
console.log('form.file',this.form.file)
this.open = true; this.open = true;
this.title = "新增社团风采"; this.title = "新增社团风采";
}, },
...@@ -378,22 +387,31 @@ export default { ...@@ -378,22 +387,31 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.uploadList = []
this.form.file = []
listCommunityInfo(ids).then((response) => { listCommunityInfo(ids).then((response) => {
console.log('修改',response)
this.form = response.data; this.form = response.data;
this.form.file = response.data.file.split(',')
console.log("this.form.file", this.form.file);
this.imageUrl = this.pev + this.form.picUrl; this.imageUrl = this.pev + this.form.picUrl;
console.log(this.imageUrl, "this.imageUrl");
this.open = true; this.open = true;
this.title = "修改园区照片"; this.title = "修改园区照片";
}); });
}, },
/** 查看按钮操作 */ /** 查看按钮操作 */
handleCheck(row) { handleCheck(row) {
this.uploadList = []
this.form.file = []
this.check = true; this.check = true;
this.open = true; this.open = true;
const ids = row.id || this.ids; const ids = row.id || this.ids;
listCommunityInfo(ids).then((response) => { listCommunityInfo(ids).then((response) => {
console.log('查看',response)
this.form = response.data; this.form = response.data;
this.form.file = response.data.file; console.log('this.form.file',this.form.file)
this.form.file = response.data.file.split(',');
console.log(this.form.file); console.log(this.form.file);
this.open = true; this.open = true;
}); });
...@@ -401,9 +419,19 @@ export default { ...@@ -401,9 +419,19 @@ export default {
}, },
// 上传成功回调 // 上传成功回调
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
this.imageUrl = res.data.url;
console.log(file); console.log('Success res',res)
this.commonUpload(file); console.log('Success file',file)
if(res.code == 200){
this.uploadList.push( this.pev + res.fileName );
this.form.file = this.uploadList
console.log('this.uploadList',this.uploadList)
console.log('this.form.file',this.form.file)
}
// this.imageUrl = res.data.url;
// console.log(file);
// this.commonUpload(file);
}, },
// 上传前格式和图片大小限制 // 上传前格式和图片大小限制
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
...@@ -427,6 +455,7 @@ export default { ...@@ -427,6 +455,7 @@ export default {
}, },
// 上传图片 // 上传图片
uploadImage(file) { uploadImage(file) {
console.log('file',file)
const fileData = file.file; const fileData = file.file;
const formData = new FormData(); const formData = new FormData();
formData.append("file", fileData); formData.append("file", fileData);
...@@ -454,7 +483,8 @@ export default { ...@@ -454,7 +483,8 @@ export default {
const params = { const params = {
id: this.form.id, id: this.form.id,
theme: this.form.theme, theme: this.form.theme,
file: this.form.file, // file: this.form.file,
file:this.uploadList.toString()
}; };
console.log(params, "params"); console.log(params, "params");
editCommunityInfo(params) editCommunityInfo(params)
...@@ -469,7 +499,7 @@ export default { ...@@ -469,7 +499,7 @@ export default {
const params = { const params = {
cid: this.$route.query.id, cid: this.$route.query.id,
theme: this.form.theme, theme: this.form.theme,
file: this.form.file, file:this.uploadList.toString()
}; };
console.log(params, "params"); console.log(params, "params");
addCommunityInfo(params) addCommunityInfo(params)
......
...@@ -21,9 +21,9 @@ export default { ...@@ -21,9 +21,9 @@ export default {
}, },
created() { created() {
// 钉钉code码,正式时打开 // 钉钉code码,正式时打开
// this.getCode() this.getCode()
// token,测试用 // token,测试用
this.csToken() // this.csToken()
}, },
methods: { methods: {
// 获取code // 获取code
...@@ -53,7 +53,7 @@ export default { ...@@ -53,7 +53,7 @@ export default {
if (res.token) { if (res.token) {
setToken(res.token) setToken(res.token)
this.$store.commit('SET_TOKEN', res.token) this.$store.commit('SET_TOKEN', res.token)
// this.$router.push({ path: '/index' }); this.$router.push({ path: '/index' });
// 判断当前用户是否已拉取完user_info信息 // 判断当前用户是否已拉取完user_info信息
this.$store.dispatch('GetInfo').then((res) => { this.$store.dispatch('GetInfo').then((res) => {
this.$store.dispatch('GenerateRoutes').then(accessRoutes => { this.$store.dispatch('GenerateRoutes').then(accessRoutes => {
......
...@@ -44,10 +44,10 @@ module.exports = { ...@@ -44,10 +44,10 @@ module.exports = {
//target: ` http://43.143.63.140:8848`, //target: ` http://43.143.63.140:8848`,
//target: ` http://43.143.63.140:8095`, //target: ` http://43.143.63.140:8095`,
//部署时后端地址 //部署时后端地址
//target: `http://47.105.176.202:8137`, target: `http://47.105.176.202:5131`,
//学校内网 //学校内网
// target: `http://10.20.100.201:57321`, // target: `http://10.20.100.201:57321`,
target: `http://47.105.176.202:5112`, // target: `http://47.105.176.202:5112`,
// target: `http://192.168.1.113:8848`, // target: `http://192.168.1.113:8848`,
changeOrigin: true, changeOrigin: true,
......
...@@ -100,4 +100,5 @@ public class SchoolClass extends OurBaseEntity { ...@@ -100,4 +100,5 @@ public class SchoolClass extends OurBaseEntity {
"7=物理+地理+化学,8=物理+地理+生物,9=物理+化学+生物,10=物理+历史+地理,11=化学+政治+地理,12=化学+政治+历史" + "7=物理+地理+化学,8=物理+地理+生物,9=物理+化学+生物,10=物理+历史+地理,11=化学+政治+地理,12=化学+政治+历史" +
"13=化学+政治+生物,14=化学+历史+地理,15=化学+历史+生物,16=化学+地理+生物,17=生物+政治+地理,18=生物+历史+地理,19=生物+政治+历史,20=政治+历史+地理",width = 25) "13=化学+政治+生物,14=化学+历史+地理,15=化学+历史+生物,16=化学+地理+生物,17=生物+政治+地理,18=生物+历史+地理,19=生物+政治+历史,20=政治+历史+地理",width = 25)
private String chooseCourse; private String chooseCourse;
private String ddClassId;
} }
...@@ -36,4 +36,7 @@ public class SchoolGrade extends OurBaseEntity { ...@@ -36,4 +36,7 @@ public class SchoolGrade extends OurBaseEntity {
/** 级部名称 */ /** 级部名称 */
@Excel(name = "级部名称") @Excel(name = "级部名称")
private String gradeName; private String gradeName;
private String ddClassId;
} }
...@@ -147,6 +147,8 @@ public class SchoolStudent extends OurBaseEntity { ...@@ -147,6 +147,8 @@ public class SchoolStudent extends OurBaseEntity {
private String support; private String support;
//独生子女(0否 1是) //独生子女(0否 1是)
private String onlyChild; private String onlyChild;
//钉钉userId
private String ddUserId;
/* /*
* 校园一卡通 * 校园一卡通
......
...@@ -43,6 +43,9 @@ public interface SchoolClassMapper extends BaseMapper<SchoolClass> { ...@@ -43,6 +43,9 @@ public interface SchoolClassMapper extends BaseMapper<SchoolClass> {
* @return * @return
*/ */
List<SchoolClassVo> getUserClassByTeacher(Long teacherId); List<SchoolClassVo> getUserClassByTeacher(Long teacherId);
List<SchoolClassVo> selectSchoolClassSchoolYear(String schoolYear);
List<SchoolClassVo> getTeacherClass(@Param("teacherId") Long teacherId, List<SchoolClassVo> getTeacherClass(@Param("teacherId") Long teacherId,
@Param("schoolYear") int schoolYear); @Param("schoolYear") int schoolYear);
...@@ -63,4 +66,6 @@ public interface SchoolClassMapper extends BaseMapper<SchoolClass> { ...@@ -63,4 +66,6 @@ public interface SchoolClassMapper extends BaseMapper<SchoolClass> {
* 获取本级部下的班级 * 获取本级部下的班级
* */ * */
List<Long> getClassesIdByGradeId(Long gradeId); List<Long> getClassesIdByGradeId(Long gradeId);
public Long selectDdClassId(String ddClssId);
} }
...@@ -31,4 +31,6 @@ public interface SchoolGradeMapper extends BaseMapper<SchoolGrade> { ...@@ -31,4 +31,6 @@ public interface SchoolGradeMapper extends BaseMapper<SchoolGrade> {
public List<String> getYearList(); public List<String> getYearList();
List<SchoolGrade> selectNowSchoolGrade(); List<SchoolGrade> selectNowSchoolGrade();
public Long selectDdClassId(String ddClssId);
} }
...@@ -151,6 +151,12 @@ public class SchoolClassImpl extends ServiceImpl<SchoolClassMapper, SchoolClass> ...@@ -151,6 +151,12 @@ public class SchoolClassImpl extends ServiceImpl<SchoolClassMapper, SchoolClass>
return schoolClassMapper.getTeacherClass(teacherId,schoolYear); return schoolClassMapper.getTeacherClass(teacherId,schoolYear);
} }
@Override
public List<SchoolClassVo> selectSchoolClassSchoolYear(String schoolYear) {
return schoolClassMapper.selectSchoolClassSchoolYear(schoolYear);
}
@Override @Override
public void checkImport(List<SchoolClassDrVo> list) { public void checkImport(List<SchoolClassDrVo> list) {
//是否为空 //是否为空
...@@ -2427,4 +2433,8 @@ public class SchoolClassImpl extends ServiceImpl<SchoolClassMapper, SchoolClass> ...@@ -2427,4 +2433,8 @@ public class SchoolClassImpl extends ServiceImpl<SchoolClassMapper, SchoolClass>
} }
@Override
public Long selectDdClassId(String ddId) {
return schoolClassMapper.selectDdClassId(ddId);
}
} }
...@@ -8,15 +8,19 @@ import com.ruoyi.common.utils.DateUtils; ...@@ -8,15 +8,19 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.mapper.SysUserMapper;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import yangtz.cs.liu.campus.domain.schoolEquipment.SchoolCirculation; import yangtz.cs.liu.campus.domain.schoolEquipment.SchoolCirculation;
import yangtz.cs.liu.campus.domain.schoolEquipment.SchoolEquipmentLedger;
import yangtz.cs.liu.campus.mapper.schoolEquipment.CirculationMapper; import yangtz.cs.liu.campus.mapper.schoolEquipment.CirculationMapper;
import yangtz.cs.liu.campus.mapper.schoolEquipment.EquipmentLedgerMapper;
import yangtz.cs.liu.campus.service.schoolEquipment.ICirculationService; import yangtz.cs.liu.campus.service.schoolEquipment.ICirculationService;
import yangtz.cs.liu.campus.vo.schoolEquipment.SchoolCirculationVo; import yangtz.cs.liu.campus.vo.schoolEquipment.SchoolCirculationVo;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import yangtz.cs.liu.campus.vo.schoolEquipment.SchoolReceiveQuery; import yangtz.cs.liu.campus.vo.schoolEquipment.SchoolReceiveQuery;
...@@ -28,6 +32,8 @@ public class CirculationServiceImpl extends ServiceImpl<CirculationMapper, Schoo ...@@ -28,6 +32,8 @@ public class CirculationServiceImpl extends ServiceImpl<CirculationMapper, Schoo
private CirculationMapper circulationMapper; private CirculationMapper circulationMapper;
@Autowired @Autowired
private SysUserMapper sysUserMapper; private SysUserMapper sysUserMapper;
@Autowired
private EquipmentLedgerMapper equipmentLedgerMapper;
@Override @Override
public List<SchoolCirculationVo> getReturningEquipmentByadminId(SchoolReceiveQuery schoolReceiveQuery) { public List<SchoolCirculationVo> getReturningEquipmentByadminId(SchoolReceiveQuery schoolReceiveQuery) {
...@@ -100,6 +106,15 @@ public class CirculationServiceImpl extends ServiceImpl<CirculationMapper, Schoo ...@@ -100,6 +106,15 @@ public class CirculationServiceImpl extends ServiceImpl<CirculationMapper, Schoo
String userName = sysUserMapper.selectUserById(schoolCirculation.getReceivedById()).getUserName(); String userName = sysUserMapper.selectUserById(schoolCirculation.getReceivedById()).getUserName();
schoolCirculation.setReceivedBy(userName); schoolCirculation.setReceivedBy(userName);
} }
if (StringUtils.isNotNull(schoolCirculation.getReturnTime())){
if (schoolCirculation.getReturnTime().before(DateUtils.getNowDate()) || schoolCirculation.getReturnTime().equals(DateUtils.getNowDate())){
schoolCirculation.setReturnState("1");
SchoolEquipmentLedger schoolEquipmentLedger = new SchoolEquipmentLedger();
schoolEquipmentLedger.setId(schoolCirculation.getEquipmentId());
schoolEquipmentLedger.setIsLend("0");
equipmentLedgerMapper.updateById(schoolEquipmentLedger);
}
}
schoolCirculation.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName()); schoolCirculation.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolCirculation.setCreateTime(DateUtils.getNowDate()); schoolCirculation.setCreateTime(DateUtils.getNowDate());
return circulationMapper.insert(schoolCirculation); return circulationMapper.insert(schoolCirculation);
...@@ -121,6 +136,15 @@ public class CirculationServiceImpl extends ServiceImpl<CirculationMapper, Schoo ...@@ -121,6 +136,15 @@ public class CirculationServiceImpl extends ServiceImpl<CirculationMapper, Schoo
String userName = sysUserMapper.selectUserById(schoolCirculation.getReceivedById()).getUserName(); String userName = sysUserMapper.selectUserById(schoolCirculation.getReceivedById()).getUserName();
schoolCirculation.setReceivedBy(userName); schoolCirculation.setReceivedBy(userName);
} }
if (StringUtils.isNotNull(schoolCirculation.getReturnTime())){
if (schoolCirculation.getReturnTime().before(DateUtils.getNowDate()) || schoolCirculation.getReturnTime().equals(DateUtils.getNowDate())){
schoolCirculation.setReturnState("1");
SchoolEquipmentLedger schoolEquipmentLedger = new SchoolEquipmentLedger();
schoolEquipmentLedger.setId(schoolCirculation.getEquipmentId());
schoolEquipmentLedger.setIsLend("0");
equipmentLedgerMapper.updateById(schoolEquipmentLedger);
}
}
schoolCirculation.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName()); schoolCirculation.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolCirculation.setUpdateTime(DateUtils.getNowDate()); schoolCirculation.setUpdateTime(DateUtils.getNowDate());
return circulationMapper.updateById(schoolCirculation); return circulationMapper.updateById(schoolCirculation);
......
...@@ -20,6 +20,7 @@ import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherExperimentApplyMapper; ...@@ -20,6 +20,7 @@ import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherExperimentApplyMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply; import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoollTeacherExperimentApplyLabsMapper; import yangtz.cs.liu.campus.mapper.schoolLab.SchoollTeacherExperimentApplyLabsMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoollTeacherExperimentApplyLabsService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo;
/** /**
...@@ -33,7 +34,8 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT ...@@ -33,7 +34,8 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
{ {
@Autowired @Autowired
private SchoolTeacherExperimentApplyMapper schoolTeacherExperimentApplyMapper; private SchoolTeacherExperimentApplyMapper schoolTeacherExperimentApplyMapper;
@Autowired
private ISchoollTeacherExperimentApplyLabsService schoollTeacherExperimentApplyLabsService;
/** /**
* 查询教师个人实验申请 * 查询教师个人实验申请
* *
...@@ -43,7 +45,12 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT ...@@ -43,7 +45,12 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
@Override @Override
public SchoolTeacherExperimentApplyVo selectSchoolTeacherExperimentApplyById(Long id) public SchoolTeacherExperimentApplyVo selectSchoolTeacherExperimentApplyById(Long id)
{ {
return schoolTeacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyById(id); SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo = schoolTeacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyById(id);
LambdaQueryWrapper<SchoolTeacherExperimentApplyLabs> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolTeacherExperimentApplyLabs::getTeacherExperimentApplyId,schoolTeacherExperimentApplyVo.getId());
List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabs = schoollTeacherExperimentApplyLabsService.list(wrapper);
schoolTeacherExperimentApplyVo.setSchoolTeacherExperimentApplyLabsList(schoolTeacherExperimentApplyLabs);
return schoolTeacherExperimentApplyVo;
} }
/** /**
...@@ -55,7 +62,14 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT ...@@ -55,7 +62,14 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
@Override @Override
public List<SchoolTeacherExperimentApplyVo> selectSchoolTeacherExperimentApplyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo) public List<SchoolTeacherExperimentApplyVo> selectSchoolTeacherExperimentApplyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo)
{ {
return schoolTeacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo); List<SchoolTeacherExperimentApplyVo> schoolTeacherExperimentApplyVos = schoolTeacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo);
for ( SchoolTeacherExperimentApplyVo date : schoolTeacherExperimentApplyVos){
LambdaQueryWrapper<SchoolTeacherExperimentApplyLabs> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolTeacherExperimentApplyLabs::getTeacherExperimentApplyId,date.getId());
List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabs = schoollTeacherExperimentApplyLabsService.list(wrapper);
date.setSchoolTeacherExperimentApplyLabsList(schoolTeacherExperimentApplyLabs);
}
return schoolTeacherExperimentApplyVos;
} }
@Override @Override
......
...@@ -80,6 +80,7 @@ public class ISchoolGradeImpl extends ServiceImpl<SchoolGradeMapper, SchoolGrade ...@@ -80,6 +80,7 @@ public class ISchoolGradeImpl extends ServiceImpl<SchoolGradeMapper, SchoolGrade
//如果是级部成员 //如果是级部成员
List<Long> ids = schoolGradeMapper.getMemberGradeId(userId, schoolYear); List<Long> ids = schoolGradeMapper.getMemberGradeId(userId, schoolYear);
if (StringUtils.isNull(ids) || ids.size() == 0) { if (StringUtils.isNull(ids) || ids.size() == 0) {
throw new ServiceException("当前学年为" + schoolYear + "学年,该学年没有您所在的级部信息"); throw new ServiceException("当前学年为" + schoolYear + "学年,该学年没有您所在的级部信息");
} }
return ids.get(0); return ids.get(0);
...@@ -237,4 +238,9 @@ public class ISchoolGradeImpl extends ServiceImpl<SchoolGradeMapper, SchoolGrade ...@@ -237,4 +238,9 @@ public class ISchoolGradeImpl extends ServiceImpl<SchoolGradeMapper, SchoolGrade
public int isNewSchoolYear() { public int isNewSchoolYear() {
return schoolGradeMapper.isNewSchoolYear(); return schoolGradeMapper.isNewSchoolYear();
} }
@Override
public Long selectDdClassId(String ddId) {
return schoolGradeMapper.selectDdClassId(ddId);
}
} }
...@@ -16,10 +16,8 @@ import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesNoticeService; ...@@ -16,10 +16,8 @@ import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesNoticeService;
import yangtz.cs.liu.campus.vo.teacherFiles.SchoolClassByGradeVo; import yangtz.cs.liu.campus.vo.teacherFiles.SchoolClassByGradeVo;
import yangtz.cs.liu.campus.vo.teacherFiles.SchoolGradeByClassVo; import yangtz.cs.liu.campus.vo.teacherFiles.SchoolGradeByClassVo;
import java.util.HashMap; import java.text.SimpleDateFormat;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.UUID;
/** /**
...@@ -178,7 +176,15 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService ...@@ -178,7 +176,15 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService
teacherFiles.setIdCard(schoolTeacher.getIdCard()); teacherFiles.setIdCard(schoolTeacher.getIdCard());
teacherFiles.setSex(schoolTeacher.getSex()); teacherFiles.setSex(schoolTeacher.getSex());
teacherFiles.setEducation(schoolTeacher.getEducation()); teacherFiles.setEducation(schoolTeacher.getEducation());
teacherFiles.setAge(1); System.out.println(schoolTeacher.getTeacherName()+"---------"+schoolTeacher.getBirthday());
Date birthday = schoolTeacher.getBirthday();
if(birthday!=null){
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy");
Integer birthdayYear = Integer.valueOf(dateFormat.format(birthday));
Date date = new Date();
Integer nowYear = Integer.valueOf(dateFormat.format(date));
teacherFiles.setAge(nowYear-birthdayYear);
}
teacherFiles.setTitle(""); teacherFiles.setTitle("");
teacherFiles.setAppearance(""); teacherFiles.setAppearance("");
return teacherFiles; return teacherFiles;
......
...@@ -39,6 +39,9 @@ public interface ISchoolClassService extends IService<SchoolClass> { ...@@ -39,6 +39,9 @@ public interface ISchoolClassService extends IService<SchoolClass> {
List<SchoolClassVo> getTeacherClass(Long teacherId); List<SchoolClassVo> getTeacherClass(Long teacherId);
List<SchoolClassVo> selectSchoolClassSchoolYear(String schoolYear);
// /** // /**
// * 校验 // * 校验
// * @param list // * @param list
...@@ -88,4 +91,8 @@ public interface ISchoolClassService extends IService<SchoolClass> { ...@@ -88,4 +91,8 @@ public interface ISchoolClassService extends IService<SchoolClass> {
/**批量新增班级*/ /**批量新增班级*/
int batchAdd(ClassBatchVo vo); int batchAdd(ClassBatchVo vo);
Long selectDdClassId(String ddId);
} }
...@@ -25,5 +25,6 @@ public interface ISchoolGradeService extends IService<SchoolGrade> { ...@@ -25,5 +25,6 @@ public interface ISchoolGradeService extends IService<SchoolGrade> {
//获取最新学年 //获取最新学年
int isNewSchoolYear(); int isNewSchoolYear();
Long selectDdClassId(String ddId);
} }
...@@ -301,4 +301,5 @@ public class SchoolStudentVO { ...@@ -301,4 +301,5 @@ public class SchoolStudentVO {
//教务-学生管理-学籍表-所在年级 //教务-学生管理-学籍表-所在年级
private String currentGrade; private String currentGrade;
private String ddUserId;
} }
...@@ -5,10 +5,17 @@ package yangtz.cs.liu.dingding.config; ...@@ -5,10 +5,17 @@ package yangtz.cs.liu.dingding.config;
*/ */
public class Constant { public class Constant {
//测试 事件回调配置
public static final String AES_TOKEN="jGt2S7Kqh475czbgxtr7j1cQsXHWYia"; public static final String AES_TOKEN="jGt2S7Kqh475czbgxtr7j1cQsXHWYia";
public static final String AES_KEY="hz6q2qTgLGD5SHWLvVddOm9HfvrKgKBcDCCf145egyi"; public static final String AES_KEY="hz6q2qTgLGD5SHWLvVddOm9HfvrKgKBcDCCf145egyi";
public static final String OWNER_KEY = "dingclpf8qoxvinhksyh"; public static final String OWNER_KEY = "dingclpf8qoxvinhksyh";
//正式 事件回调配置
// public static final String AES_TOKEN="awLoV2xJlrg6xUK3wQIF88HhVuSVS7Tmpb5MKFI1j7DaLKcn";
//
// public static final String AES_KEY="xGO08pQerwFgBOcabx2eUxLUrAOwa5Q2FJtdylY7ksf";
//
// public static final String OWNER_KEY = "dingggqchzyvxm9e6e7v";
} }
...@@ -115,8 +115,9 @@ public class DdAppLoginController { ...@@ -115,8 +115,9 @@ public class DdAppLoginController {
wxLoginBody.setOpenId(unionId); wxLoginBody.setOpenId(unionId);
wxLoginBody.setParentTelephone(sysUser.getPhonenumber()); wxLoginBody.setParentTelephone(sysUser.getPhonenumber());
if (null != sysUser.getStudentId()){ if (null != sysUser.getStudentId()){
SchoolStudent schoolStudent = schoolStudentMapper.selectByIdCard(sysUser.getStudentId().toString()); SchoolStudent schoolStudent = schoolStudentMapper.selectById(sysUser.getStudentId().toString());
wxLoginBody.setStudentIdCard(schoolStudent.getIdCard()); wxLoginBody.setStudentIdCard(schoolStudent.getIdCard());
wxLoginBody.setStudentName(schoolStudent.getStudentName());
} }
wxLoginBody.setParentName(sysUser.getUserName()); wxLoginBody.setParentName(sysUser.getUserName());
wxLoginBody.setTeacherName(sysUser.getUserName()); wxLoginBody.setTeacherName(sysUser.getUserName());
......
package yangtz.cs.liu.dingding.controller;
import cn.hutool.http.HttpUtil;
//import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.core.domain.entity.SchoolTeacher;
import com.ruoyi.common.core.domain.entity.SchoolTeacherCopy;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysUserService;
import org.apache.regexp.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yangtz.cs.liu.campus.controller.schoolClass.SchoolClassController;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassCopy;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassHeadmaster;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassMentor;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGradeCopy;
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.service.schoolClass.ISchoolClassCopyService;
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.schoolgrade.ISchoolGradeCopyService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeMentorService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeService;
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.campus.service.teacher.ISchoolTeacherCopyService;
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;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 家校通讯录
*/
@RestController
@RequestMapping("/dd/djtx")
public class DingJiaXiaoController {
@Autowired
private AccessTokenUtils accessTokenUtils;
final String listUrl ="https://oapi.dingtalk.com/topapi/edu/dept/list?access_token=";
final String userUrl ="https://oapi.dingtalk.com/topapi/edu/user/list?access_token=";
//年级表
@Autowired
ISchoolGradeService schoolGradeService;
//年级临时表
@Autowired
ISchoolGradeCopyService iSchoolGradeCopyService;
//职工与年级关系 ----------------
@Autowired
ISchoolGradeMentorService schoolGradeMentorService;
//学校班级
@Autowired
ISchoolClassService iSchoolClassService;
//班级表临时
@Autowired
ISchoolClassCopyService iSchoolClassCopyService;
//班主任和班级关系 ------------------
@Autowired
ISchoolClassHeadmasterService iSchoolClassHeadmasterService;
//任课老师和班级关系 ----------------
@Autowired
ISchoolClassMentorService schoolClassMentorService;
//学生表 ---------------------
@Autowired
ISchoolStudentService schoolStudentService;
//学生与班级关系 --------------------
@Autowired
ISchoolStudentClassRelationService iSchoolStudentClassRelationService;
//学生历史班级表 -----------------
@Autowired
ISchoolStudentClassesService schoolStudentClassesService;
//家长信息表 ---------------------
@Autowired
ISchoolStudentParentService iSchoolStudentParentService;
//老师表
@Autowired
ISchoolTeacherService schoolTeacherService;
//老师表 临时表
@Autowired
ISchoolTeacherCopyService schoolTeacherCopyService;
//用户表 ----------------
@Autowired
ISysUserService sysUserService;
public List<String> userTypes = new ArrayList<String>(){
{
this.add("teacher");
this.add("guardian");
this.add("student");
}
};
//更新年级与班级
@GetMapping("/updateLabClassYear")
private String updateLabClassYear(){
String token = accessTokenUtils.getToken();
//年级
List<SchoolGrade> schoolGradeCopies = new ArrayList<>();
// 0 获取校园信息
JSONObject jsonObjectParme = new JSONObject();
jsonObjectParme.put("page_no",1);
jsonObjectParme.put("page_size",30);
String post = HttpUtil.post(listUrl+token, jsonObjectParme);
JSONObject jsonObject = JSONObject.parseObject(post);
if ((Integer) jsonObject.get("errcode") != 0){
throw new RuntimeException("获取校园列表失败");
}
Integer deptId = null;
JSONObject result = (JSONObject)jsonObject.get("result");
JSONArray detailsArray = JSONArray.of(result.get("details"));
for (int i = 0 ; i < detailsArray.size(); i ++){
JSONObject da = detailsArray.getJSONArray(i).getJSONObject(i);
deptId = (Integer) da.get("dept_id");
}
//1 获取校园学历类型
JSONObject xyParme = new JSONObject();
xyParme.put("page_no",1);
xyParme.put("page_size",30);
xyParme.put("super_id",deptId);
String xyPost = HttpUtil.post(listUrl+token, xyParme);
JSONObject xyObject = JSONObject.parseObject(xyPost);
if ((Integer) xyObject.get("errcode") != 0){
throw new RuntimeException("获取年纪列表失败");
}
JSONObject xyResult = (JSONObject)xyObject.get("result");
JSONArray xyDetailsArray = JSONArray.of(xyResult.get("details"));
for (int i = 0 ; i < xyDetailsArray.size(); i ++){
JSONObject da = xyDetailsArray.getJSONArray(i).getJSONObject(i);
deptId = (Integer) da.get("dept_id");
}
//2.获取校园年级
JSONObject njParme = new JSONObject();
njParme.put("page_no",1);
njParme.put("page_size",30);
njParme.put("super_id",deptId);
String njPost = HttpUtil.post(listUrl+token, njParme);
JSONObject njObject = JSONObject.parseObject(njPost);
if ((Integer) njObject.get("errcode") != 0){
throw new RuntimeException("获取年纪列表失败");
}
JSONObject njResult = (JSONObject)njObject.get("result");
JSONArray njDetailsArray = JSONArray.of(njResult.get("details"));
for (int i = 0 ; i < njDetailsArray.size(); i ++) {
for (int q = 0; q < njDetailsArray.getJSONArray(i).size(); q++) {
JSONObject da = njDetailsArray.getJSONArray(i).getJSONObject(q);
String grName = (String) da.get("name");
//截取级部 2022级
String gradeJi = grName.substring(grName.length() - 5);
String grade = gradeJi.substring(0,gradeJi.length()-1);
//获取年级 一年级
String gradeName = grName.substring(0, grName.length() - 5);
//级部id
Integer suId = (Integer) da.get("dept_id");
SchoolGrade schoolGrade = new SchoolGrade();
schoolGrade.setGradeValue(Integer.valueOf(this.gradeSubt(gradeName)));
schoolGrade.setGradeYear(grade);
schoolGrade.setGradeName(gradeJi+"部");
schoolGrade.setRemark(gradeName);
schoolGrade.setDdClassId(String.valueOf(suId));
schoolGrade.setCreateTime(new Date());
schoolGrade.setCreateBy("admin");
schoolGrade.setDelFlag("0");
schoolGrade.setUpdateBy("admin");
schoolGrade.setUpdateTime(new Date());
schoolGradeCopies.add(schoolGrade);
}
}
//对年级进行排序 找出最新年级 设则最新学年状态 并且找出班级 进行保存
List<SchoolGrade> collect = schoolGradeCopies.stream().sorted(Comparator.comparing(SchoolGrade::getGradeYear, Comparator.reverseOrder())).collect(Collectors.toList());
//最新学年
String schoolYear = collect.get(0).getGradeYear();
for (int i = 0; i < collect.size();i++) {
collect.get(i).setSchoolYear(schoolYear);
if (i >= 3){
//当前第四个以上不是新学年 更新数据库新学年状态
List<SchoolGrade> schoolGradeCopies1 = schoolGradeService.queryList(collect.get(i));
if (schoolGradeCopies1.isEmpty()){
collect.get(i).setSfzxxn("1");
schoolGradeService.save(collect.get(i));
}else {
for (SchoolGrade date : schoolGradeCopies1){
date.setSfzxxn("1");
schoolGradeService.updateById(date);
}
}
continue;
}
//追加学年
List<SchoolGrade> schoolGradeCopies1 = schoolGradeService.queryList(collect.get(i));
if (schoolGradeCopies1.isEmpty()){
//追加
collect.get(i).setSfzxxn("0");
schoolGradeService.save(collect.get(i));
}
}
//追加班级
for ( SchoolGrade date: collect){
if (date.getId()==null){
Long l = schoolGradeService.selectDdClassId(date.getDdClassId());
date.setId(l);
}
//查找班级
//保存班级
JSONArray ddHttp = this.getDdHttp(date.getDdClassId(), token);
JSONArray jsonArrays = ddHttp.getJSONArray(0);
for (int i = 0 ; i < jsonArrays.size() ; i++){
//查询当前班级是否存在
String classDdId = jsonArrays.getJSONObject(i).get("dept_id").toString();
Long classId = iSchoolClassService.selectDdClassId(classDdId);
if (null != classId){
SchoolClass schoolClass = new SchoolClass();
schoolClass.setSchoolYear(Integer.valueOf(date.getSchoolYear()));
schoolClass.setClassType("4");
schoolClass.setGradeValue(date.getGradeValue());
schoolClass.setGradeName(date.getGradeName());
schoolClass.setClassValue(Integer.valueOf(jsonArrays.getJSONObject(i).getJSONObject("feature").get("class_level").toString()));
String className = jsonArrays.getJSONObject(i).get("name").toString();
schoolClass.setClassName(className.substring(className.length()-2));
schoolClass.setClassAlias(jsonArrays.getJSONObject(i).get("name").toString());
schoolClass.setUpdateBy("admin");
schoolClass.setUpdateTime(new Date());
schoolClass.setGradeId(date.getId());
schoolClass.setDdClassId(classDdId);
schoolClass.setId(classId);
iSchoolClassService.updateById(schoolClass);
}else {
SchoolClass schoolClass = new SchoolClass();
schoolClass.setSchoolYear(Integer.valueOf(date.getSchoolYear()));
schoolClass.setClassType("4");
schoolClass.setGradeValue(date.getGradeValue());
schoolClass.setGradeName(date.getGradeName());
schoolClass.setClassValue(Integer.valueOf(jsonArrays.getJSONObject(i).getJSONObject("feature").get("class_level").toString()));
String className = jsonArrays.getJSONObject(i).get("name").toString();
schoolClass.setClassName(className.substring(className.length()-2));
schoolClass.setClassAlias(jsonArrays.getJSONObject(i).get("name").toString());
schoolClass.setCreateBy("admin");
schoolClass.setCreateTime(new Date());
schoolClass.setUpdateBy("admin");
schoolClass.setUpdateTime(new Date());
schoolClass.setGradeId(date.getId());
schoolClass.setDdClassId(classDdId);
iSchoolClassService.save(schoolClass);
}
}
}
return "";
}
//更新追加人员信息
@GetMapping("/updateLabUser")
private String updateLabUser(){
//查找当前学年 所有的班级
String nowSchoolYear = iSchoolGradeCopyService.selectUpToYear();
SchoolClass schoolClass = new SchoolClass();
schoolClass.setSchoolYear(Integer.valueOf(nowSchoolYear));
List<SchoolClass> schoolClassCopies = iSchoolClassService.selectSchoolClassList(schoolClass);
String token = accessTokenUtils.getToken();
for (SchoolClass date : schoolClassCopies){
//查询班级下边的人员 包含三种人员查询
//学生信息
List<DingJiaXiaoVo.StudentUserInfo> studentUserInfos = new ArrayList<>();
//老师信息
List<DingJiaXiaoVo.StudentUserInfo> teacherUserInfos = new ArrayList<>();
//监护人信息*
List<DingJiaXiaoVo.StudentUserInfo> guardianUserInfos = new ArrayList<>();
SchoolTeacherVO schoolTeacher = new SchoolTeacherVO();
//分页查询,每次查询数据最大只有30条,分5次查询 一个班判断最大150人
for (String type : userTypes) {
if (type.equals("teacher")) {
//同步家校通讯老师
teacherUserInfos = this.addUserList(token, type, date.getDdClassId());
for (DingJiaXiaoVo.StudentUserInfo teachDate : teacherUserInfos){
// 关联老师跟班级信息
schoolTeacher.setTeacherName(teachDate.getName());
List<SchoolTeacher> schoolTeacherCopies = schoolTeacherService.selectSchoolTeacherList(schoolTeacher);
if (schoolTeacherCopies.isEmpty()){
throw new RuntimeException("钉钉老师未在系统中找到");
}
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();
schoolClassHeadmaster.setTeacherId(classHeadTeacher.getId());
schoolClassHeadmaster.setClassId(date.getId());
iSchoolClassHeadmasterService.save(schoolClassHeadmaster);
//设置班级 班主任信息
SchoolClass schoolClassss = new SchoolClass();
schoolClassss.setId(date.getId());
schoolClassss.setTeacherId(classHeadTeacher.getId());
schoolClassss.setTeacherName(classHeadTeacher.getTeacherName());
schoolClassss.setTeacherTel(classHeadTeacher.getTeacherTel());
iSchoolClassService.updateById(schoolClassss);
}else {
//任课老师 跟班级关系
SchoolClassMentor schoolClassMentor = new SchoolClassMentor();
schoolClassMentor.setTeacherId(classHeadTeacher.getId());
schoolClassMentor.setClassId(date.getId());
//查找部门 课程没有编写
schoolClassMentorService.save(schoolClassMentor);
}
}
} else if (type.equals("student")) {
//学生
studentUserInfos = this.addUserList(token, type, date.getDdClassId());
for (DingJiaXiaoVo.StudentUserInfo studentDte : studentUserInfos) {
//学生信息
SchoolStudent schoolStudent = new SchoolStudent();
schoolStudent.setStudentName(studentDte.getName());
schoolStudent.setClassId(date.getId());
schoolStudent.setStudentStatus("1");
schoolStudent.setDdUserId(studentDte.getUserId());
schoolStudentService.save(schoolStudent);
//学生班级信息
SchoolStudentClassRelation schoolStudentClassRelation = new SchoolStudentClassRelation();
schoolStudentClassRelation.setStudentId(schoolStudent.getId());
schoolStudentClassRelation.setClassId(date.getId());
iSchoolStudentClassRelationService.save(schoolStudentClassRelation);
//学生与班级历史关系
SchoolClassCopy school= iSchoolClassCopyService.selectSchoolClassById(date.getId());
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 (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 = schoolStudentVOS.get(0).getId();
//创建用户user表
SysUser jUser = new SysUser();
jUser.setLoginName(guarDate.getName());
jUser.setUserName(guarDate.getName());
jUser.setUserType("01");
jUser.setUserLoginType("1");
jUser.setPhonenumber(guarDate.getMobile());
jUser.setPassword(SecurityUtils.encryptPassword("123#@!"));
jUser.setStatus("0");
jUser.setDelFlag("0");
jUser.setUnionId(guarDate.getUnionid());
jUser.setRoleIds(new Long[]{111L});
jUser.setStudentId(studenId);
sysUserService.insertUser(jUser);
//家长表
SchoolStudentParent schoolStudentParent = new SchoolStudentParent() ;
schoolStudentParent.setStudentId(studenId);
schoolStudentParent.setUserId(jUser.getUserId());
schoolStudentParent.setParentName(guarDate.getName());
schoolStudentParent.setTelephone(guarDate.getMobile());
Integer patriarch = this.getPatriarch(guarDate.getName().substring(guarDate.getName().length() - 2));
schoolStudentParent.setRelationship(String.valueOf(patriarch));
iSchoolStudentParentService.save(schoolStudentParent);
}
}
}
}
return "";
}
//获取监护人详情 获取学生userid
private String getToUserId(String token,String fromUserId,String classId){
String toUserId = null;
JSONObject bjParme = new 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);
JSONObject bjObject = JSONObject.parseObject(bjPost);
if ((Integer) bjObject.get("errcode") != 0){
throw new RuntimeException("获取班级列表失败");
}
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;
}
private JSONArray getDdHttp (String supId,String token ){
JSONObject bjParme = new JSONObject();
bjParme.put("page_no",1);
bjParme.put("page_size",30);
bjParme.put("super_id",supId);
String bjPost = HttpUtil.post(listUrl+token, bjParme);
JSONObject bjObject = JSONObject.parseObject(bjPost);
if ((Integer) bjObject.get("errcode") != 0){
throw new RuntimeException("获取班级列表失败");
}
JSONObject bjResult = (JSONObject)bjObject.get("result");
JSONArray bjDetailsArray = JSONArray.of(bjResult.get("details"));
return bjDetailsArray;
}
private List<DingJiaXiaoVo.StudentUserInfo> addUserList(String token,String type,String classId){
List<DingJiaXiaoVo.StudentUserInfo> userList = new ArrayList<>();
//分页查询,每次查询数据最大只有30条,分5次查询 一个班判断最大150人
for (int k = 1;k <= 4; k++ ){
//查询班级下边的人员
JSONObject ryParme = new JSONObject();
ryParme.put("page_no",k);
ryParme.put("page_size",30);
ryParme.put("role",type);
ryParme.put("class_id",classId);
String ryPost = HttpUtil.post(userUrl+token, ryParme);
JSONObject ryObject = JSONObject.parseObject(ryPost);
if ((Integer) ryObject.get("errcode") != 0){
throw new RuntimeException("获取班级人员列表失败"+ryObject.toString());
}
JSONObject ryResult = (JSONObject)ryObject.get("result");
JSONArray xyDetailsArray = JSONArray.of(ryResult.get("details"));
for (int o = 0; o < xyDetailsArray.size(); o++){
for (int i = 0 ; i < xyDetailsArray.getJSONArray(o).size(); i++){
JSONObject userInfo = xyDetailsArray.getJSONArray(o).getJSONObject(i);
DingJiaXiaoVo.StudentUserInfo studentUserInfo = new DingJiaXiaoVo().new StudentUserInfo();
studentUserInfo.setUserId(userInfo.get("userid").toString());
studentUserInfo.setClassId((Integer) userInfo.get("class_id"));
studentUserInfo.setRole(userInfo.get("role")==null?null:userInfo.get("role").toString());
studentUserInfo.setUnionid(userInfo.get("unionid")==null?null:userInfo.get("unionid").toString());
studentUserInfo.setName(userInfo.get("name").toString());
studentUserInfo.setIsAdviser(userInfo.getJSONObject("feature").get("is_adviser") ==null ? null:userInfo.getJSONObject("feature").get("is_adviser").toString());
studentUserInfo.setStudentNo(userInfo.getJSONObject("feature").get("student_no") ==null ? null:userInfo.getJSONObject("feature").get("student_no").toString());
//学生没有手机号 不需要查询手机号
if (!type.equals("student")){
String tel = this.getTel(studentUserInfo.getUserId(), token);
studentUserInfo.setMobile(tel);
}
userList.add(studentUserInfo);
}
}
}
return userList;
}
/**
* 钉钉数据同步到数据,
* //班级、级部 、学生、家长、老师、班级关系、
// */
// @GetMapping("/updateJiaXiaoTX")
// public void updateJiaXiaoTX(){
//
// //获取钉钉数据
// List<DingJiaXiaoVo> list = null;
// //循环更新
// for (DingJiaXiaoVo njDate : list){
// //更新年级
// String gradeName = njDate.getGradeName();
// Integer gradeId = njDate.getGradeId();
// SchoolGrade schoolGrade = new SchoolGrade();
// schoolGrade.setGradeName(gradeName.substring(gradeName.length()- 5)+"部");
// schoolGrade.setGradeValue(Integer.valueOf(this.gradeSubt(gradeName.substring(3))));
// schoolGrade.setGradeYear(gradeName.substring(gradeName.length()- 5,4));
// schoolGrade.setSchoolYear(gradeName.substring(gradeName.length()- 5,4));
// schoolGrade.setRemark(gradeName);
// schoolGrade.setId(Long.valueOf(gradeId));
// schoolGradeService.save(schoolGrade);
// //获取班级
// List<DingJiaXiaoVo.ClassInfo> classInfoList = njDate.getClassInfoList();
// //遍历班级
// for (DingJiaXiaoVo.ClassInfo classDate : classInfoList){
//
//
// String teacherName =null;
//
// Integer classId = classDate.getClassId();
// String className = classDate.getClassName();
// Map<String,String> fromUserId = this.getFromUserId(Long.valueOf(classId), accessTokenUtils.getToken());
// SchoolClass schoolClass = new SchoolClass();
// schoolClass.setSchoolYear(Integer.valueOf(schoolGrade.getSchoolYear()));
// schoolClass.setClassType("4");
// schoolClass.setGradeValue(Integer.valueOf(schoolGrade.getGradeYear()));
// schoolClass.setGradeName(schoolGrade.getGradeName());
// schoolClass.setId(Long.valueOf(classId));
// schoolClass.setClassName(className);
// schoolClass.setClassValue(Integer.valueOf(className.substring(className.length()-2,1)));
// schoolClass.setClassAlias(className);
// schoolClass.setGradeId(schoolGrade.getId());
// schoolClass.setGradeId(schoolGrade.getId());
//
// //班级
// iSchoolClassService.save(schoolClass);
//
// //老师
// List<DingJiaXiaoVo.StudentUserInfo> teacherUserInfos = classDate.getTeacherUserInfos();
// for (DingJiaXiaoVo.StudentUserInfo date : teacherUserInfos){
// SysUser sysUser = new SysUser();
// sysUser.setUserId(Long.valueOf(date.getUserId()));
//// sysUser.setDept(); 部门没有
// sysUser.setLoginName(date.getName());
// sysUser.setUserName(date.getName());
// sysUser.setUserType("01");
// sysUser.setUserLoginType("0");
// sysUser.setPhonenumber(date.getMobile());
// sysUser.setPassword(SecurityUtils.encryptPassword("123456"));
// sysUser.setStatus("0");
// sysUser.setDelFlag("0");
// sysUser.setUnionId(date.getUnionid());
// sysUser.setRoleIds(new Long[]{111L});
// //用户表
// sysUserService.insertUser(sysUser);
//
// SchoolTeacher schoolTeacher = new SchoolTeacher();
// schoolTeacher.setTeacherName(date.getName());
// // schoolTeacher.setSex(); 性别没有
// schoolTeacher.setNation("汉族");
//// schoolTeacher.setTeacherCode(); 工作编号
// schoolTeacher.setUserId(sysUser.getUserId());
// schoolTeacher.setTeacherTel(date.getMobile());
// schoolTeacher.setUnionId(date.getUnionid());
// // schoolTeacher.setDeptId(); schoolTeacher.setDeptName(); 部门没有
// //老师表
// schoolTeacherService.save(schoolTeacher);
// //老师与班级关系表 缺少课程信息
//// SchoolClassMentor schoolClassMentor = new SchoolClassMentor();
//// schoolClassMentor.setTeacherId(schoolTeacher.getId());
//// schoolClassMentorService.save(schoolClassMentor);
// if (date.getIsAdviser().equals("1")){
// schoolClass.setTeacherId(schoolTeacher.getId());
// schoolClass.setTeacherName(date.getName());
// schoolClass.setTeacherTel(date.getMobile());
// teacherName = date.getName();
// SchoolClassHeadmaster schoolClassHeadmaster = new SchoolClassHeadmaster();
// schoolClassHeadmaster.setTeacherId(schoolTeacher.getId());
// schoolClassHeadmaster.setClassId(Long.valueOf(classId));
// //班主任和班级关系
// iSchoolClassHeadmasterService.save(schoolClassHeadmaster);
// }
// }
//
// //学生
// List<DingJiaXiaoVo.StudentUserInfo> studentUserInfos = classDate.getStudentUserInfos();
// for (DingJiaXiaoVo.StudentUserInfo date : studentUserInfos){
// //学生表
// SchoolStudent schoolStudent = new SchoolStudent();
// schoolStudent.setStudentName(date.getName());
//// schoolStudent.setSex();
// schoolStudent.setClassId(Long.valueOf(classId));
//// schoolStudent.setIdCard(); 身份证号
// schoolStudent.setNation("汉族");
// schoolStudent.setNationalNumber(date.getStudentNo());
// schoolStudent.setEnrollmentYear(gradeName.substring(gradeName.length()- 5,4));
// schoolStudent.setStudentStatus("1");
// schoolStudent.setId(Long.valueOf(date.getUserId()));
// schoolStudentService.save(schoolStudent);
// //学生与班级关系
// SchoolStudentClassRelation schoolStudentClassRelation = new SchoolStudentClassRelation();
// schoolStudentClassRelation.setClassId(Long.valueOf(classId));
// schoolStudentClassRelation.setStudentId(schoolStudent.getId());
// iSchoolStudentClassRelationService.save(schoolStudentClassRelation);
// //学生历史班级表
// SchoolStudentClasses schoolStudentClasses = new SchoolStudentClasses();
// schoolStudentClasses.setTeacherName(teacherName);
// schoolStudentClasses.setStudentId(schoolStudent.getId());
// schoolStudentClasses.setGrade(gradeName.substring(gradeName.length()- 5,4));
// schoolStudentClasses.setClasses(className);
// schoolStudentClassesService.save(schoolStudentClasses);
// }
// //监护人
// List<DingJiaXiaoVo.StudentUserInfo> guardianUserInfos = classDate.getGuardianUserInfos();
// for (DingJiaXiaoVo.StudentUserInfo date : guardianUserInfos){
// String studentId = fromUserId.get(date.getUserId());
//
// //创建家长用户
// SysUser jUser = new SysUser();
// jUser.setUserId(Long.valueOf(date.getUserId()));
//// sysUser.setDept(); 部门没有
// jUser.setLoginName(date.getName());
// jUser.setUserName(date.getName());
// jUser.setUserType("01");
// jUser.setUserLoginType("1");
// jUser.setPhonenumber(date.getMobile());
// jUser.setPassword(SecurityUtils.encryptPassword("123456"));
// jUser.setStatus("0");
// jUser.setDelFlag("0");
// jUser.setUnionId(date.getUnionid());
// jUser.setRoleIds(new Long[]{111L});
// jUser.setStudentId(Long.valueOf(studentId));
// sysUserService.insertUser(jUser);
// //维护家长表
// SchoolStudentParent schoolStudentParent = new SchoolStudentParent();
// schoolStudentParent.setStudentId(Long.valueOf(studentId));
// schoolStudentParent.setUserId(jUser.getUserId());
// schoolStudentParent.setParentName(date.getName());
// schoolStudentParent.setTelephone(date.getMobile());
// Integer patriarch = this.getPatriarch(date.getName().substring(date.getName().length() - 2));
// schoolStudentParent.setRelationship(patriarch.toString());
// iSchoolStudentParentService.save(schoolStudentParent);
//
// }
//
//
// iSchoolClassService.updateById(schoolClass);
//
//
// }
// }
// }
private String gradeSubt(String grade){
String gId = null;
switch (grade){
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";
case "十二年级": return gId = "12";
case "十三年级": return gId = "13";
case "十四年级": return gId = "14";
case "十五年级": return gId = "15";
case "十六年级": return gId = "16";
case "十七年级": return gId = "17";
case "十八年级": return gId = "18";
case "十九年级": return gId = "19";
case "二十年级": return gId = "20";
case "二十一年级": return gId = "21";
case "二十二级": return gId = "22";
case "二十三年级": return gId = "23";
case "二十四年级": return gId = "24";
case "二十五年级": return gId = "25";
case "二十六年级": return gId = "26";
case "二十七年级": return gId = "27";
case "二十八年级": return gId = "28";
case "二十九年级": return gId = "29";
case "三十年级": return gId = "30";
}
return gId;
}
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;
}
/**
* 调用钉钉公共接口,获取用户手机号
*/
public String getTel(String userId ,String assToKen){
JSONObject userParme = new JSONObject();
userParme.put("userid",userId);
String userPost = HttpUtil.post("https://oapi.dingtalk.com/topapi/v2/user/get?access_token="+assToKen, userParme);
JSONObject jsonObject = JSONObject.parseObject(userPost);
if (jsonObject.getJSONObject("result").get("mobile")==null){
return null;
}else {
return jsonObject.getJSONObject("result").get("mobile").toString();
}
}
/**
* 获取班级 家 学关系
*/
public Map<String,String> getFromUserId(Long classId ,String assToKen){
Map<String,String> map = new HashMap();
JSONObject userParme = new JSONObject();
userParme.put("class_id",classId);
String userPost = HttpUtil.post("https://oapi.dingtalk.com/topapi/edu/user/relation/list?access_token="+assToKen, userParme);
JSONObject jsonObject = JSONObject.parseObject(userPost);
JSONArray jsonArray = jsonObject.getJSONObject("result").getJSONArray("relations");
for (int i =0 ; i< jsonArray.size(); i++ ){
JSONObject jsonDate= jsonArray.getJSONObject(i);
String fromUserid = jsonDate.get("from_userid").toString();
String toUserid = jsonDate.get("to_userid").toString();
map.put(fromUserid,toUserid);
}
return map;
}
}
package yangtz.cs.liu.dingding.vo;
import lombok.Data;
import java.util.List;
@Data
public class DingJiaXiaoVo {
/**
* 年纪id
*/
Integer gradeId;
/**
* 年纪名称
*/
String gradeName;
/**
* 班级信息
*/
List<ClassInfo> classInfoList;
/**
* 班级信息
*/
@Data
public class ClassInfo{
/**
* 班级id
*/
Integer classId;
/**
* 年纪名称
*/
String className;
/**
* 学生信息
*/
List<StudentUserInfo> studentUserInfos;
/**
* 老师信息
*/
List<StudentUserInfo> teacherUserInfos;
/**
* 监护人信息
*/
List<StudentUserInfo> guardianUserInfos;
}
/**
* 学生信息
*/
@Data
public class StudentUserInfo{
/**
* 班级id
*/
Integer classId;
/**
* 人员的userId。
*/
String userId;
/**
* 人员姓名。
*/
String name;
/**
* 人员的unionId,无手机号的学生为""。
*/
String unionid;
/**
* 家校人员角色。
* teacher:老师
* guardian:监护人
* student:学生
*/
String role;
/**
* 只在老师角色下意义。
* 1:班主任
* 0:非班主任
*/
String isAdviser;
/**
* 学号,只有在学生角色下才有意义,并且需确认各个班级的设置,如果没有设置,则不会返回此字段。
*/
String studentNo;
/**
* 手机号
*/
String mobile;
}
}
...@@ -113,7 +113,7 @@ public class ExperimentLevelController extends BaseController { ...@@ -113,7 +113,7 @@ public class ExperimentLevelController extends BaseController {
public AjaxResult getGrade(SchoolLabClassYearVo schoolLabClassYearVo) public AjaxResult getGrade(SchoolLabClassYearVo schoolLabClassYearVo)
{ //获取最新学年 { //获取最新学年
int schoolYear = gradeService.isNewSchoolYear(); int schoolYear = gradeService.isNewSchoolYear();
return AjaxResult.success(schoolExperimentPlanService.getGrade(schoolYear,schoolLabClassYearVo.getUserId())); return AjaxResult.success(schoolExperimentPlanService.getGrade(schoolYear,schoolLabClassYearVo.getUserId()));
} }
/** /**
......
...@@ -3,14 +3,19 @@ package yangtz.cs.liu.wechat.controller.experiment; ...@@ -3,14 +3,19 @@ package yangtz.cs.liu.wechat.controller.experiment;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.MpLoginUser;
import com.ruoyi.framework.util.UserInfoUtil; import com.ruoyi.framework.util.UserInfoUtil;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear; import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply; import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply; import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
...@@ -38,6 +43,10 @@ public class TeacherExperimentController extends BaseController { ...@@ -38,6 +43,10 @@ public class TeacherExperimentController extends BaseController {
@Autowired @Autowired
ISchoolLabClassYearService schoolLabClassYearService; ISchoolLabClassYearService schoolLabClassYearService;
//学校班级
@Autowired
ISchoolClassService iSchoolClassService;
/** /**
* 个人申请记录 * 个人申请记录
*/ */
...@@ -89,6 +98,11 @@ public class TeacherExperimentController extends BaseController { ...@@ -89,6 +98,11 @@ public class TeacherExperimentController extends BaseController {
@Autowired @Autowired
ISysUserService userService; ISysUserService userService;
@Autowired
ISysRoleService roleService;
@Autowired
ISysDictDataService dictDataService;
/** /**
* 获取班级 * 获取班级
*/ */
...@@ -139,6 +153,28 @@ public class TeacherExperimentController extends BaseController { ...@@ -139,6 +153,28 @@ public class TeacherExperimentController extends BaseController {
} }
/** /**
* 获取当前登录角色学科
*/
@GetMapping("/getSubject")
public AjaxResult getSubject(){
Long userId = userInfoUtil.getMpLoginUser().getUserId();
List<SysRole> sysRoles = roleService.selectRolesByUserIdDdApp(userId);
for (SysRole role : sysRoles) {
if (role.getRoleKey().equals("phy_lab_admin")){
return AjaxResult.success(dictDataService.selectDictLabel("lab_sub","1"));
}else if (role.getRoleKey().equals("che_lab_admin")){
return AjaxResult.success(dictDataService.selectDictLabel("lab_sub","2"));
}else if (role.getRoleKey().equals("bio_lab_admin")){
return AjaxResult.success(dictDataService.selectDictLabel("lab_sub","3"));
}
}
return AjaxResult.success("当前用户未分配学科角色");
}
/**
*新增申请 *新增申请
*/ */
@PostMapping("/apply/add") @PostMapping("/apply/add")
...@@ -170,7 +206,7 @@ public class TeacherExperimentController extends BaseController { ...@@ -170,7 +206,7 @@ public class TeacherExperimentController extends BaseController {
/** /**
* 删除教师个人实验申请 * 删除教师个人实验申请
*/ */
@PostMapping("/apply/{ids}") @DeleteMapping("/apply/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
return toAjax(schoolTeacherExperimentApplyService.deleteSchoolTeacherExperimentApplyByIds(ids)); return toAjax(schoolTeacherExperimentApplyService.deleteSchoolTeacherExperimentApplyByIds(ids));
......
...@@ -38,6 +38,16 @@ ...@@ -38,6 +38,16 @@
order by g.grade_value, g.class_value order by g.grade_value, g.class_value
</select> </select>
<select id="selectSchoolClassSchoolYear" resultMap="SchoolClassResult">
select g.grade_value, g.grade_name, g.class_value, g.class_name, g.school_year, g.id
from school_class g
where g.del_flag = '0'
and g.school_year = #{schoolYear}
order by g.grade_value, g.class_value
</select>
<select id="getUserClassByParent" resultType="SchoolClass"> <select id="getUserClassByParent" resultType="SchoolClass">
SELECT sg.pic_url, SELECT sg.pic_url,
sg.class_value, sg.class_value,
...@@ -149,4 +159,9 @@ ...@@ -149,4 +159,9 @@
where del_flag = '0' and grade_id = #{gradeId} where del_flag = '0' and grade_id = #{gradeId}
</select> </select>
<select id="selectDdClassId" resultType="java.lang.Long">
select sg.id from school_class_copy sg
where sg.del_flag = '0' and sg.dd_class_id=#{ddClssId}
</select>
</mapper> </mapper>
...@@ -70,6 +70,9 @@ ...@@ -70,6 +70,9 @@
<if test="applyName != null and applyName != ''"> and tla.apply_name like concat('%', #{applyName}, '%')</if> <if test="applyName != null and applyName != ''"> and tla.apply_name like concat('%', #{applyName}, '%')</if>
<if test="applyTime != null "> and tla.apply_time = #{applyTime}</if> <if test="applyTime != null "> and tla.apply_time = #{applyTime}</if>
<if test="state != null "> and tla.state = #{state}</if> <if test="state != null "> and tla.state = #{state}</if>
<if test="querText != null ">
and concat(tla.experiment_name,tla.grade) like concat('%', #{querText}, '%')
</if>
<if test="subs != null "> <if test="subs != null ">
and tla.sub in and tla.sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")"> <foreach item="sub" collection="subs" open="(" separator="," close=")">
......
...@@ -54,5 +54,8 @@ ...@@ -54,5 +54,8 @@
<include refid="selectSchoolGradeVo"/> <include refid="selectSchoolGradeVo"/>
where school_year = (select max(school_year) from school_grade ) where school_year = (select max(school_year) from school_grade )
</select> </select>
<select id="selectDdClassId" resultType="java.lang.Long">
select sg.id from school_grade_copy sg
where sg.del_flag = '0' and sg.dd_class_id=#{ddClssId}
</select>
</mapper> </mapper>
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
<result property="appearance" column="appearance"/> <result property="appearance" column="appearance"/>
<result property="registeredAddress" column="registered_address"/> <result property="registeredAddress" column="registered_address"/>
<result property="registeredType" column="registered_type"/> <result property="registeredType" column="registered_type"/>
<result property="ddUserId" column="dd_user_id"/>
</resultMap> </resultMap>
<sql id="selectSchoolStudentVo"> <sql id="selectSchoolStudentVo">
...@@ -42,6 +43,7 @@ ...@@ -42,6 +43,7 @@
native_place, native_place,
avatar, avatar,
id_card, id_card,
dd_user_id,
school_no, school_no,
student_status, student_status,
student_type, student_type,
...@@ -72,6 +74,7 @@ ...@@ -72,6 +74,7 @@
<if test="studentStatus != null">student_status,</if> <if test="studentStatus != null">student_status,</if>
<if test="studentType != null">student_type,</if> <if test="studentType != null">student_type,</if>
<if test="oneCard != null and oneCard != ''">one_card,</if> <if test="oneCard != null and oneCard != ''">one_card,</if>
<if test="ddUserId != null and oneCard != ''">dd_user_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="classId != null">#{classId},</if> <if test="classId != null">#{classId},</if>
...@@ -90,6 +93,7 @@ ...@@ -90,6 +93,7 @@
<if test="studentStatus != null">#{studentStatus},</if> <if test="studentStatus != null">#{studentStatus},</if>
<if test="studentType != null">#{studentType},</if> <if test="studentType != null">#{studentType},</if>
<if test="oneCard != null and oneCard != ''">#{oneCard},</if> <if test="oneCard != null and oneCard != ''">#{oneCard},</if>
<if test="ddUserId != null and ddUserId != ''">#{ddUserId},</if>
</trim> </trim>
</insert> </insert>
...@@ -100,7 +104,7 @@ ...@@ -100,7 +104,7 @@
<select id="queryList" parameterType="SchoolStudentVO" resultType="yangtz.cs.liu.campus.vo.student.SchoolStudentVO"> <select id="queryList" parameterType="SchoolStudentVO" resultType="yangtz.cs.liu.campus.vo.student.SchoolStudentVO">
select ss.id,ss.class_id,ss.student_name,ss.sex,ss.birthday,ss.nation,ss.stu_telephone,ss.postal_code, select ss.id,ss.class_id,ss.student_name,ss.sex,ss.birthday,ss.nation,ss.stu_telephone,ss.postal_code,
ss.nature,ss.provincial_number,ss.national_number,ss.enrollment_year,ss.home_address, ss.nature,ss.provincial_number,ss.national_number,ss.enrollment_year,ss.home_address,
ss.native_place, ss.avatar, ss.id_card,ss.school_no, ss.student_status, ss.platform, ss.native_place, ss.avatar,ss.dd_user_id, ss.id_card,ss.school_no, ss.student_status, ss.platform,
ss.birth_address,ss.postal_address,ss.junior_school,ss.region,ss.foreign_languages, ss.birth_address,ss.postal_address,ss.junior_school,ss.region,ss.foreign_languages,
ss.blood_type,ss.health,ss.other_regions,ss.floating_population,ss.support,ss.only_child, ss.blood_type,ss.health,ss.other_regions,ss.floating_population,ss.support,ss.only_child,
ss.student_type, ss.one_card, ss.enrollment_time, ss.appearance, ss.registered_address, ss.registered_type, ss.student_type, ss.one_card, ss.enrollment_time, ss.appearance, ss.registered_address, ss.registered_type,
...@@ -123,6 +127,7 @@ ...@@ -123,6 +127,7 @@
<if test="schoolNo != null and schoolNo != ''">and ss.school_no like concat('%', #{schoolNo}, '%')</if> <if test="schoolNo != null and schoolNo != ''">and ss.school_no like concat('%', #{schoolNo}, '%')</if>
<if test="studentStatus != null and studentStatus !=''">and ss.student_status = #{studentStatus}</if> <if test="studentStatus != null and studentStatus !=''">and ss.student_status = #{studentStatus}</if>
<if test="studentType != null and studentType !=''">and ss.student_type = #{studentType}</if> <if test="studentType != null and studentType !=''">and ss.student_type = #{studentType}</if>
<if test="ddUserId != null and ddUserId !=''">and ss.dd_user_id = #{ddUserId}</if>
</where> </where>
order by ss.class_id asc order by ss.class_id asc
</select> </select>
...@@ -146,6 +151,7 @@ ...@@ -146,6 +151,7 @@
<if test="studentStatus != null and studentStatus !=''">and student_status = #{studentStatus}</if> <if test="studentStatus != null and studentStatus !=''">and student_status = #{studentStatus}</if>
<if test="studentType != null and studentType !=''">and student_type = #{studentType}</if> <if test="studentType != null and studentType !=''">and student_type = #{studentType}</if>
<if test="oneCard != null and oneCard !=''">and one_card = #{oneCard}</if> <if test="oneCard != null and oneCard !=''">and one_card = #{oneCard}</if>
<if test="ddUserId != null and ddUserId !=''">and dd_user_id = #{ddUserId}</if>
and del_flag = '0' and del_flag = '0'
</where> </where>
order by create_time desc order by create_time desc
...@@ -179,6 +185,7 @@ ...@@ -179,6 +185,7 @@
ss.student_type, ss.student_type,
ss.one_card, ss.one_card,
sg.class_alias sg.class_alias
sg.dd_user_id
FROM school_student ss FROM school_student ss
LEFT JOIN school_class sg ON sg.id = ss.class_id LEFT JOIN school_class sg ON sg.id = ss.class_id
LEFT JOIN school_teacher st ON st.id = sg.teacher_id LEFT JOIN school_teacher st ON st.id = sg.teacher_id
...@@ -213,6 +220,7 @@ ...@@ -213,6 +220,7 @@
ssp.parent_name, ssp.parent_name,
ssp.relationship, ssp.relationship,
ssp.telephone ssp.telephone
ssp.dd_user_id
FROM school_student s FROM school_student s
LEFT JOIN school_class sg on sg.id = s.class_id LEFT JOIN school_class sg on sg.id = s.class_id
LEFT JOIN school_student_parent ssp on ssp.student_id = s.id LEFT JOIN school_student_parent ssp on ssp.student_id = s.id
...@@ -244,7 +252,7 @@ ...@@ -244,7 +252,7 @@
<select id="getInfo" resultType="yangtz.cs.liu.campus.vo.student.SchoolStudentVO"> <select id="getInfo" resultType="yangtz.cs.liu.campus.vo.student.SchoolStudentVO">
select ss.id,ss.class_id,ss.student_name,ss.sex,ss.birthday,ss.nation,ss.stu_telephone,ss.postal_code, select ss.id,ss.class_id,ss.student_name,ss.sex,ss.birthday,ss.nation,ss.stu_telephone,ss.postal_code,
ss.nature,ss.provincial_number,ss.national_number,ss.enrollment_year,ss.home_address, ss.nature,ss.provincial_number,ss.national_number,ss.enrollment_year,ss.home_address,
ss.native_place, ss.avatar, ss.id_card,ss.school_no, ss.student_status, ss.platform, ss.native_place, ss.avatar,ss.dd_user_id, ss.id_card,ss.school_no, ss.student_status, ss.platform,
ss.birth_address,ss.postal_address,ss.junior_school,ss.region,ss.foreign_languages, ss.birth_address,ss.postal_address,ss.junior_school,ss.region,ss.foreign_languages,
ss.blood_type,ss.health,ss.other_regions,ss.floating_population,ss.support,ss.only_child, ss.blood_type,ss.health,ss.other_regions,ss.floating_population,ss.support,ss.only_child,
ss.student_type, ss.one_card, ss.enrollment_time, ss.appearance, ss.registered_address, ss.registered_type, ss.student_type, ss.one_card, ss.enrollment_time, ss.appearance, ss.registered_address, ss.registered_type,
...@@ -284,7 +292,7 @@ ...@@ -284,7 +292,7 @@
<select id="getInfoByidCard" resultType="yangtz.cs.liu.campus.vo.student.SchoolStudentVO"> <select id="getInfoByidCard" resultType="yangtz.cs.liu.campus.vo.student.SchoolStudentVO">
select ss.id,ss.class_id,ss.student_name,ss.sex,ss.birthday,ss.nation,ss.stu_telephone,ss.postal_code, select ss.id,ss.class_id,ss.student_name,ss.sex,ss.birthday,ss.nation,ss.stu_telephone,ss.postal_code,
ss.nature,ss.provincial_number,ss.national_number,ss.enrollment_year,ss.home_address, ss.nature,ss.provincial_number,ss.national_number,ss.enrollment_year,ss.home_address,
ss.native_place,sc.school_year, ss.avatar, ss.id_card,ss.school_no, ss.student_status,ss.platform, ss.native_place,sc.school_year, ss.dd_user_id,ss.avatar, ss.id_card,ss.school_no, ss.student_status,ss.platform,
ss.birth_address,ss.postal_address,ss.junior_school,ss.region,ss.foreign_languages, ss.birth_address,ss.postal_address,ss.junior_school,ss.region,ss.foreign_languages,
ss.blood_type,ss.health,ss.other_regions,ss.floating_population,ss.support,ss.only_child, ss.blood_type,ss.health,ss.other_regions,ss.floating_population,ss.support,ss.only_child,
ss.student_type, ss.one_card, ss.enrollment_time, ss.appearance, ss.registered_address, ss.registered_type, ss.student_type, ss.one_card, ss.enrollment_time, ss.appearance, ss.registered_address, ss.registered_type,
...@@ -314,6 +322,7 @@ ...@@ -314,6 +322,7 @@
<if test="data.studentStatus != null and data.studentStatus != ''">student_status,</if> <if test="data.studentStatus != null and data.studentStatus != ''">student_status,</if>
<if test="data.studentType != null and data.studentType != ''">student_type,</if> <if test="data.studentType != null and data.studentType != ''">student_type,</if>
<if test="data.oneCard != null and data.oneCard != ''">one_card,</if> <if test="data.oneCard != null and data.oneCard != ''">one_card,</if>
<if test="data.ddUserId != null and data.ddUserId != ''">dd_user_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="data.classId != null">#{data.classId},</if> <if test="data.classId != null">#{data.classId},</if>
...@@ -330,6 +339,7 @@ ...@@ -330,6 +339,7 @@
<if test="data.studentStatus != null and data.studentStatus != ''">#{data.studentStatus},</if> <if test="data.studentStatus != null and data.studentStatus != ''">#{data.studentStatus},</if>
<if test="data.studentType != null and data.studentType != ''">#{data.studentType},</if> <if test="data.studentType != null and data.studentType != ''">#{data.studentType},</if>
<if test="data.oneCard != null and data.oneCard != ''">#{data.oneCard},</if> <if test="data.oneCard != null and data.oneCard != ''">#{data.oneCard},</if>
<if test="data.ddUserId != null and data.ddUserId != ''">#{data.ddUserId},</if>
</trim> </trim>
</foreach> </foreach>
</insert> </insert>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment