幼儿导入功能
This commit is contained in:
parent
cc0c36ea89
commit
8e1658187f
@ -86,4 +86,12 @@ export function listChildCheck(query) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 下载用户导入模板
|
||||||
|
export function importTemplate() {
|
||||||
|
return request({
|
||||||
|
url: '/benyi/child/importTemplate',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
@ -1,6 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="姓名" prop="name">
|
<el-form-item label="姓名" prop="name">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.name"
|
v-model="queryParams.name"
|
||||||
@ -43,8 +48,16 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -56,7 +69,8 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['benyi:child:add']"
|
v-hasPermi="['benyi:child:add']"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -66,7 +80,8 @@
|
|||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['benyi:child:edit']"
|
v-hasPermi="['benyi:child:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -76,7 +91,8 @@
|
|||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['benyi:child:remove']"
|
v-hasPermi="['benyi:child:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -86,36 +102,99 @@
|
|||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleTiaoban"
|
@click="handleTiaoban"
|
||||||
v-hasPermi="['benyi:child:edit']"
|
v-hasPermi="['benyi:child:edit']"
|
||||||
>调班</el-button>
|
>调班</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip effect="dark" content="点我,可以复制链接发送给所有家长补填幼儿信息呦" placement="top-start">
|
<el-button
|
||||||
|
type="info"
|
||||||
|
icon="el-icon-upload2"
|
||||||
|
size="mini"
|
||||||
|
@click="handleImport"
|
||||||
|
v-hasPermi="['benyi:child:import']"
|
||||||
|
>导入</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-tooltip
|
||||||
|
effect="dark"
|
||||||
|
content="点我,可以复制链接发送给所有家长补填幼儿信息呦"
|
||||||
|
placement="top-start"
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-document-copy"
|
icon="el-icon-document-copy"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="copy($event,inviteCode)"
|
@click="copy($event, inviteCode)"
|
||||||
v-hasPermi="['benyi:child:add']"
|
v-hasPermi="['benyi:child:add']"
|
||||||
>家长填报链接</el-button>
|
>家长填报链接</el-button
|
||||||
|
>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="childList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="childList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="编号" align="center" prop="id" />
|
<el-table-column label="编号" align="center" prop="id" />
|
||||||
<!-- <el-table-column label="幼儿园名称" align="center" prop="schoolid" /> -->
|
<!-- <el-table-column label="幼儿园名称" align="center" prop="schoolid" /> -->
|
||||||
<el-table-column label="班级名称" align="center" prop="classid" :formatter="classFormat" />
|
<el-table-column
|
||||||
|
label="班级名称"
|
||||||
|
align="center"
|
||||||
|
prop="classid"
|
||||||
|
:formatter="classFormat"
|
||||||
|
/>
|
||||||
<el-table-column label="姓名" align="center" prop="name" />
|
<el-table-column label="姓名" align="center" prop="name" />
|
||||||
<el-table-column label="家长手机号码" align="center" prop="phone" />
|
<el-table-column label="家长手机号码" align="center" prop="phone" />
|
||||||
<el-table-column label="性别" align="center" prop="xb" :formatter="xbFormat" />
|
<el-table-column
|
||||||
<el-table-column label="民族" align="center" prop="mz" :formatter="mzFormat" />
|
label="性别"
|
||||||
<el-table-column label="详细地址" show-overflow-tooltip align="center" prop="addrDetail" />
|
align="center"
|
||||||
<el-table-column label="曾经就读幼儿园" align="center" prop="everSchool" />
|
prop="xb"
|
||||||
<el-table-column label="是否学习英语" align="center" prop="learnEnglish" :formatter="ynFormat" />
|
:formatter="xbFormat"
|
||||||
<el-table-column label="入园渠道" align="center" prop="source" :formatter="sourceFormat" />
|
/>
|
||||||
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
|
<el-table-column
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
label="民族"
|
||||||
|
align="center"
|
||||||
|
prop="mz"
|
||||||
|
:formatter="mzFormat"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="详细地址"
|
||||||
|
show-overflow-tooltip
|
||||||
|
align="center"
|
||||||
|
prop="addrDetail"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="曾经就读幼儿园"
|
||||||
|
align="center"
|
||||||
|
prop="everSchool"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="是否学习英语"
|
||||||
|
align="center"
|
||||||
|
prop="learnEnglish"
|
||||||
|
:formatter="ynFormat"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="入园渠道"
|
||||||
|
align="center"
|
||||||
|
prop="source"
|
||||||
|
:formatter="sourceFormat"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="状态"
|
||||||
|
align="center"
|
||||||
|
prop="status"
|
||||||
|
:formatter="statusFormat"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -123,20 +202,22 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['benyi:child:edit']"
|
v-hasPermi="['benyi:child:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['benyi:child:remove']"
|
v-hasPermi="['benyi:child:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@ -256,12 +337,18 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="详细地址" prop="addrDetail">
|
<el-form-item label="详细地址" prop="addrDetail">
|
||||||
<el-input v-model="form.addrDetail" placeholder="请输入详细地址" />
|
<el-input
|
||||||
|
v-model="form.addrDetail"
|
||||||
|
placeholder="请输入详细地址"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="曾就读园" prop="everSchool">
|
<el-form-item label="曾就读园" prop="everSchool">
|
||||||
<el-input v-model="form.everSchool" placeholder="请输入曾经就读幼儿园" />
|
<el-input
|
||||||
|
v-model="form.everSchool"
|
||||||
|
placeholder="请输入曾经就读幼儿园"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -271,7 +358,8 @@
|
|||||||
v-for="dict in ynOptions"
|
v-for="dict in ynOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictValue"
|
:label="dict.dictValue"
|
||||||
>{{dict.dictLabel}}</el-radio>
|
>{{ dict.dictLabel }}</el-radio
|
||||||
|
>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -294,23 +382,35 @@
|
|||||||
v-for="dict in statusOptions"
|
v-for="dict in statusOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictValue"
|
:label="dict.dictValue"
|
||||||
>{{dict.dictLabel}}</el-radio>
|
>{{ dict.dictLabel }}</el-radio
|
||||||
|
>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="第一语言" prop="firstLanguage">
|
<el-form-item label="第一语言" prop="firstLanguage">
|
||||||
<el-input v-model="form.firstLanguage" placeholder="请输入第一语言" maxlength="2"/>
|
<el-input
|
||||||
|
v-model="form.firstLanguage"
|
||||||
|
placeholder="请输入第一语言"
|
||||||
|
maxlength="2"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="第二语言" prop="seconderLanguage">
|
<el-form-item label="第二语言" prop="seconderLanguage">
|
||||||
<el-input v-model="form.seconderLanguage" placeholder="请输入第二语言" maxlength="2" />
|
<el-input
|
||||||
|
v-model="form.seconderLanguage"
|
||||||
|
placeholder="请输入第二语言"
|
||||||
|
maxlength="2"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="其他语言" prop="otherLanguage">
|
<el-form-item label="其他语言" prop="otherLanguage">
|
||||||
<el-input v-model="form.otherLanguage" placeholder="请输入其他语言" />
|
<el-input
|
||||||
|
v-model="form.otherLanguage"
|
||||||
|
placeholder="请输入其他语言"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -333,7 +433,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 幼儿调班信息对话框 -->
|
<!-- 幼儿调班信息对话框 -->
|
||||||
<el-dialog title="幼儿调班" :visible.sync="open_tb" width="400px" append-to-body>
|
<el-dialog
|
||||||
|
title="幼儿调班"
|
||||||
|
:visible.sync="open_tb"
|
||||||
|
width="400px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
<el-form ref="form" :model="form" :rules="rules_tb" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules_tb" label-width="80px">
|
||||||
<el-form-item label="选择班级" prop="classid">
|
<el-form-item label="选择班级" prop="classid">
|
||||||
<el-select v-model="form.classid" placeholder="请选择班级">
|
<el-select v-model="form.classid" placeholder="请选择班级">
|
||||||
@ -351,6 +456,40 @@
|
|||||||
<el-button @click="cancel_tb">取 消</el-button>
|
<el-button @click="cancel_tb">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 用户导入对话框 -->
|
||||||
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px">
|
||||||
|
<el-upload
|
||||||
|
ref="upload"
|
||||||
|
:limit="1"
|
||||||
|
accept=".xlsx, .xls"
|
||||||
|
:headers="upload.headers"
|
||||||
|
:action="upload.url"
|
||||||
|
:disabled="upload.isUploading"
|
||||||
|
:on-progress="handleFileUploadProgress"
|
||||||
|
:on-success="handleFileSuccess"
|
||||||
|
:auto-upload="false"
|
||||||
|
drag
|
||||||
|
>
|
||||||
|
<i class="el-icon-upload"></i>
|
||||||
|
<div class="el-upload__text">
|
||||||
|
将文件拖到此处,或
|
||||||
|
<em>点击上传</em>
|
||||||
|
</div>
|
||||||
|
<div class="el-upload__tip" slot="tip">
|
||||||
|
<el-link type="info" style="font-size: 12px" @click="importTemplate"
|
||||||
|
>下载模板</el-link
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="el-upload__tip" style="color: red" slot="tip">
|
||||||
|
提示:仅允许导入“xls”或“xlsx”格式文件!
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
|
<el-button @click="upload.open = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -362,9 +501,11 @@ import {
|
|||||||
addChild,
|
addChild,
|
||||||
updateChild,
|
updateChild,
|
||||||
updateChild_tb,
|
updateChild_tb,
|
||||||
|
importTemplate,
|
||||||
} from "@/api/benyi/child";
|
} from "@/api/benyi/child";
|
||||||
|
|
||||||
import { listClass } from "@/api/system/class";
|
import { listClass } from "@/api/system/class";
|
||||||
|
import { getToken } from "@/utils/auth";
|
||||||
|
|
||||||
//导入省市区三级联动库
|
//导入省市区三级联动库
|
||||||
import VDistpicker from "v-distpicker";
|
import VDistpicker from "v-distpicker";
|
||||||
@ -430,6 +571,19 @@ export default {
|
|||||||
classOptions: [],
|
classOptions: [],
|
||||||
//是否可编辑
|
//是否可编辑
|
||||||
isable: false,
|
isable: false,
|
||||||
|
// 幼儿导入参数
|
||||||
|
upload: {
|
||||||
|
// 是否显示弹出层(用户导入)
|
||||||
|
open: false,
|
||||||
|
// 弹出层标题(用户导入)
|
||||||
|
title: "",
|
||||||
|
// 是否禁用上传
|
||||||
|
isUploading: false,
|
||||||
|
// 设置上传的请求头部
|
||||||
|
headers: { Authorization: "Bearer " + getToken() },
|
||||||
|
// 上传的地址
|
||||||
|
url: process.env.VUE_APP_BASE_API + "/benyi/child/importData",
|
||||||
|
},
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -516,6 +670,11 @@ export default {
|
|||||||
VDistpicker,
|
VDistpicker,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/** 导入按钮操作 */
|
||||||
|
handleImport() {
|
||||||
|
this.upload.title = "幼儿数据导入";
|
||||||
|
this.upload.open = true;
|
||||||
|
},
|
||||||
// 链接内容
|
// 链接内容
|
||||||
getLink() {
|
getLink() {
|
||||||
getUserProfile().then((response) => {
|
getUserProfile().then((response) => {
|
||||||
@ -523,7 +682,7 @@ export default {
|
|||||||
//console.log(domain);
|
//console.log(domain);
|
||||||
//this.user = response.data;
|
//this.user = response.data;
|
||||||
this.inviteCode =
|
this.inviteCode =
|
||||||
response.data.dept.deptName +
|
response.data.dept.deptName +
|
||||||
"幼儿信息维护链接" +
|
"幼儿信息维护链接" +
|
||||||
"http://" +
|
"http://" +
|
||||||
domain +
|
domain +
|
||||||
@ -834,6 +993,28 @@ export default {
|
|||||||
this.form.addrArea = data.area.code;
|
this.form.addrArea = data.area.code;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/** 下载模板操作 */
|
||||||
|
importTemplate() {
|
||||||
|
importTemplate().then((response) => {
|
||||||
|
this.download(response.msg);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 文件上传中处理
|
||||||
|
handleFileUploadProgress(event, file, fileList) {
|
||||||
|
this.upload.isUploading = true;
|
||||||
|
},
|
||||||
|
// 文件上传成功处理
|
||||||
|
handleFileSuccess(response, file, fileList) {
|
||||||
|
this.upload.open = false;
|
||||||
|
this.upload.isUploading = false;
|
||||||
|
this.$refs.upload.clearFiles();
|
||||||
|
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
// 提交上传文件
|
||||||
|
submitFileForm() {
|
||||||
|
this.$refs.upload.submit();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
@ -3,7 +3,11 @@ package com.ruoyi.project.benyi.controller;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
|
import com.ruoyi.framework.security.LoginUser;
|
||||||
|
import com.ruoyi.framework.security.service.TokenService;
|
||||||
import com.ruoyi.project.common.SchoolCommon;
|
import com.ruoyi.project.common.SchoolCommon;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -23,6 +27,7 @@ import com.ruoyi.framework.web.controller.BaseController;
|
|||||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 幼儿信息Controller
|
* 幼儿信息Controller
|
||||||
@ -37,6 +42,8 @@ public class ByChildController extends BaseController {
|
|||||||
private IByChildService byChildService;
|
private IByChildService byChildService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SchoolCommon schoolCommon;
|
private SchoolCommon schoolCommon;
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询幼儿信息列表
|
* 查询幼儿信息列表
|
||||||
@ -84,6 +91,26 @@ public class ByChildController extends BaseController {
|
|||||||
return util.exportExcel(list, "child");
|
return util.exportExcel(list, "child");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||||
|
@PreAuthorize("@ss.hasPermi('benyi:child:import')")
|
||||||
|
@PostMapping("/importData")
|
||||||
|
public AjaxResult importData(MultipartFile file) throws Exception {
|
||||||
|
ExcelUtil<ByChild> util = new ExcelUtil<ByChild>(ByChild.class);
|
||||||
|
List<ByChild> childList = util.importExcel(file.getInputStream());
|
||||||
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||||
|
String operName = loginUser.getUsername();
|
||||||
|
Long deptId = loginUser.getUser().getDeptId();
|
||||||
|
String bjbh=schoolCommon.getClassId();
|
||||||
|
String message = byChildService.importChild(childList, operName,deptId,bjbh);
|
||||||
|
return AjaxResult.success(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/importTemplate")
|
||||||
|
public AjaxResult importTemplate() {
|
||||||
|
ExcelUtil<ByChild> util = new ExcelUtil<ByChild>(ByChild.class);
|
||||||
|
return util.importTemplateExcel("幼儿数据");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取幼儿信息详细信息
|
* 获取幼儿信息详细信息
|
||||||
*/
|
*/
|
||||||
|
@ -25,13 +25,13 @@ public class ByChild extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 学校id
|
* 学校id
|
||||||
*/
|
*/
|
||||||
@Excel(name = "学校id")
|
// @Excel(name = "学校id")
|
||||||
private Long schoolid;
|
private Long schoolid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级id
|
* 班级id
|
||||||
*/
|
*/
|
||||||
@Excel(name = "班级id")
|
// @Excel(name = "班级id")
|
||||||
private String classid;
|
private String classid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,13 +43,13 @@ public class ByChild extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 英文名
|
* 英文名
|
||||||
*/
|
*/
|
||||||
@Excel(name = "英文名")
|
// @Excel(name = "英文名")
|
||||||
private String enName;
|
private String enName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小名
|
* 小名
|
||||||
*/
|
*/
|
||||||
@Excel(name = "小名")
|
// @Excel(name = "小名")
|
||||||
private String infantName;
|
private String infantName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,205 +61,202 @@ public class ByChild extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 性别
|
* 性别
|
||||||
*/
|
*/
|
||||||
@Excel(name = "性别")
|
// @Excel(name = "性别")
|
||||||
private String xb;
|
private String xb;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 民族
|
* 民族
|
||||||
*/
|
*/
|
||||||
@Excel(name = "民族")
|
// @Excel(name = "民族")
|
||||||
private String mz;
|
private String mz;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 证件号码
|
* 证件号码
|
||||||
*/
|
*/
|
||||||
@Excel(name = "证件号码")
|
// @Excel(name = "证件号码")
|
||||||
private String zjhm;
|
private String zjhm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出生日期
|
* 出生日期
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
|
// @Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date csrq;
|
private Date csrq;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出生所在省
|
* 出生所在省
|
||||||
*/
|
*/
|
||||||
@Excel(name = "出生所在省")
|
// @Excel(name = "出生所在省")
|
||||||
private String birthProvince;
|
private String birthProvince;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出生所在省名称
|
* 出生所在省名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "出生所在省名称")
|
// @Excel(name = "出生所在省名称")
|
||||||
private String birthProvincename;
|
private String birthProvincename;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出生所在地市
|
* 出生所在地市
|
||||||
*/
|
*/
|
||||||
@Excel(name = "出生所在地市")
|
// @Excel(name = "出生所在地市")
|
||||||
private String birthCity;
|
private String birthCity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出生所在市名称
|
* 出生所在市名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "出生所在市名称")
|
// @Excel(name = "出生所在市名称")
|
||||||
private String birthCityname;
|
private String birthCityname;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出生地区
|
* 出生地区
|
||||||
*/
|
*/
|
||||||
@Excel(name = "出生地区")
|
// @Excel(name = "出生地区")
|
||||||
private String birthArea;
|
private String birthArea;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出生所在区名称
|
* 出生所在区名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "出生所在区名称")
|
// @Excel(name = "出生所在区名称")
|
||||||
private String birthAreaname;
|
private String birthAreaname;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 户口所在地
|
* 户口所在地
|
||||||
*/
|
*/
|
||||||
@Excel(name = "户口所在地")
|
// @Excel(name = "户口所在地")
|
||||||
private String registeredProvince;
|
private String registeredProvince;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 户口所在地名称
|
* 户口所在地名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "户口所在地名称")
|
// @Excel(name = "户口所在地名称")
|
||||||
private String registeredProvincename;
|
private String registeredProvincename;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 户口所在地市
|
* 户口所在地市
|
||||||
*/
|
*/
|
||||||
@Excel(name = "户口所在地市")
|
// @Excel(name = "户口所在地市")
|
||||||
private String registeredCity;
|
private String registeredCity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 户口所在市名称
|
* 户口所在市名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "户口所在市名称")
|
// @Excel(name = "户口所在市名称")
|
||||||
private String registeredCityname;
|
private String registeredCityname;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 户口所在区
|
* 户口所在区
|
||||||
*/
|
*/
|
||||||
@Excel(name = "户口所在区")
|
// @Excel(name = "户口所在区")
|
||||||
private String registeredArea;
|
private String registeredArea;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 户口所在区名称
|
* 户口所在区名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "户口所在区名称")
|
// @Excel(name = "户口所在区名称")
|
||||||
private String registeredAreaname;
|
private String registeredAreaname;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 住址省
|
* 住址省
|
||||||
*/
|
*/
|
||||||
@Excel(name = "住址省")
|
// @Excel(name = "住址省")
|
||||||
private String addrProvince;
|
private String addrProvince;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 住址省名称
|
* 住址省名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "住址省名称")
|
// @Excel(name = "住址省名称")
|
||||||
private String addrProvincename;
|
private String addrProvincename;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 住址市
|
* 住址市
|
||||||
*/
|
*/
|
||||||
@Excel(name = "住址市")
|
// @Excel(name = "住址市")
|
||||||
private String addrCity;
|
private String addrCity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 住址市名称
|
* 住址市名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "住址市名称")
|
// @Excel(name = "住址市名称")
|
||||||
private String addrCityname;
|
private String addrCityname;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 住址区
|
* 住址区
|
||||||
*/
|
*/
|
||||||
@Excel(name = "住址区")
|
// @Excel(name = "住址区")
|
||||||
private String addrArea;
|
private String addrArea;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 住址区名称
|
* 住址区名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "住址区名称")
|
// @Excel(name = "住址区名称")
|
||||||
private String addrAreaname;
|
private String addrAreaname;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详细地址
|
* 详细地址
|
||||||
*/
|
*/
|
||||||
@Excel(name = "详细地址")
|
// @Excel(name = "详细地址")
|
||||||
private String addrDetail;
|
private String addrDetail;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 曾经就读幼儿园
|
* 曾经就读幼儿园
|
||||||
*/
|
*/
|
||||||
@Excel(name = "曾经就读幼儿园")
|
// @Excel(name = "曾经就读幼儿园")
|
||||||
private String everSchool;
|
private String everSchool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否学习英语
|
* 是否学习英语
|
||||||
*/
|
*/
|
||||||
@Excel(name = "是否学习英语")
|
// @Excel(name = "是否学习英语")
|
||||||
private String learnEnglish;
|
private String learnEnglish;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入园渠道
|
* 入园渠道
|
||||||
*/
|
*/
|
||||||
@Excel(name = "入园渠道")
|
// @Excel(name = "入园渠道")
|
||||||
private String source;
|
private String source;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态
|
* 状态
|
||||||
*/
|
*/
|
||||||
@Excel(name = "状态")
|
// @Excel(name = "状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入园时间
|
* 入园时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "入园时间", width = 30, dateFormat = "yyyy-MM-dd")
|
// @Excel(name = "入园时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date enterDate;
|
private Date enterDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 离园时间
|
* 离园时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "离园时间", width = 30, dateFormat = "yyyy-MM-dd")
|
// @Excel(name = "离园时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date outDate;
|
private Date outDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 第一语言
|
* 第一语言
|
||||||
*/
|
*/
|
||||||
@Excel(name = "第一语言")
|
// @Excel(name = "第一语言")
|
||||||
private String firstLanguage;
|
private String firstLanguage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 第二语言
|
* 第二语言
|
||||||
*/
|
*/
|
||||||
@Excel(name = "第二语言")
|
// @Excel(name = "第二语言")
|
||||||
private String seconderLanguage;
|
private String seconderLanguage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其他语言
|
* 其他语言
|
||||||
*/
|
*/
|
||||||
@Excel(name = "其他语言")
|
// @Excel(name = "其他语言")
|
||||||
private String otherLanguage;
|
private String otherLanguage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人
|
* 创建人
|
||||||
*/
|
*/
|
||||||
@Excel(name = "创建人")
|
// @Excel(name = "创建人")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private Long createuserid;
|
private Long createuserid;
|
||||||
|
|
||||||
private ByChildContactpeople byChildContactpeople;
|
private ByChildContactpeople byChildContactpeople;
|
||||||
@ -549,10 +546,6 @@ public class ByChild extends BaseEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
@ -74,4 +74,15 @@ public interface ByChildMapper {
|
|||||||
* @return 班级信息集合
|
* @return 班级信息集合
|
||||||
*/
|
*/
|
||||||
public List<ByChild> selectststicstClassList(ByChild byChild);
|
public List<ByChild> selectststicstClassList(ByChild byChild);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入用户数据
|
||||||
|
*
|
||||||
|
* @param userChild 用户数据列表
|
||||||
|
* @param operName 操作用户
|
||||||
|
* @param deptId 部门id
|
||||||
|
* @param bjbh 班级编号
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public String importChild(List<ByChild> userChild, String operName, Long deptId, String bjbh);
|
||||||
}
|
}
|
||||||
|
@ -74,4 +74,15 @@ public interface IByChildService {
|
|||||||
* @return 班级信息集合
|
* @return 班级信息集合
|
||||||
*/
|
*/
|
||||||
public List<ByChild> selectststicstClassList(ByChild byChild);
|
public List<ByChild> selectststicstClassList(ByChild byChild);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入用户数据
|
||||||
|
*
|
||||||
|
* @param userChild 用户数据列表
|
||||||
|
* @param operName 操作用户
|
||||||
|
* @param deptId 部门id
|
||||||
|
* @param bjbh 班级编号
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public String importChild(List<ByChild> userChild, String operName, Long deptId, String bjbh);
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,15 @@ package com.ruoyi.project.benyi.service.impl;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.common.exception.CustomException;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
|
import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
|
||||||
|
import com.ruoyi.project.system.domain.SysUser;
|
||||||
|
import com.ruoyi.project.system.service.impl.SysUserServiceImpl;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
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 com.ruoyi.project.benyi.mapper.ByChildMapper;
|
import com.ruoyi.project.benyi.mapper.ByChildMapper;
|
||||||
@ -18,6 +25,7 @@ import com.ruoyi.project.benyi.service.IByChildService;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ByChildServiceImpl implements IByChildService {
|
public class ByChildServiceImpl implements IByChildService {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
||||||
@Autowired
|
@Autowired
|
||||||
private ByChildMapper byChildMapper;
|
private ByChildMapper byChildMapper;
|
||||||
|
|
||||||
@ -111,4 +119,49 @@ public class ByChildServiceImpl implements IByChildService {
|
|||||||
public List<ByChild> selectststicstClassList(ByChild byChild) {
|
public List<ByChild> selectststicstClassList(ByChild byChild) {
|
||||||
return byChildMapper.selectststicstClassList(byChild);
|
return byChildMapper.selectststicstClassList(byChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入用户数据
|
||||||
|
*
|
||||||
|
* @param userChild 用户数据列表
|
||||||
|
* @param operName 操作用户
|
||||||
|
* @param deptId 部门id
|
||||||
|
* @param bjbh 班级编号
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String importChild(List<ByChild> userChild, String operName, Long deptId, String bjbh) {
|
||||||
|
if (StringUtils.isNull(userChild) || userChild.size() == 0) {
|
||||||
|
throw new CustomException("导入幼儿数据不能为空!");
|
||||||
|
}
|
||||||
|
int successNum = 0;
|
||||||
|
int failureNum = 0;
|
||||||
|
StringBuilder successMsg = new StringBuilder();
|
||||||
|
StringBuilder failureMsg = new StringBuilder();
|
||||||
|
for (ByChild byChild : userChild) {
|
||||||
|
try {
|
||||||
|
if (bjbh == null || "".equals(bjbh)) {
|
||||||
|
} else {
|
||||||
|
byChild.setClassid(bjbh);
|
||||||
|
}
|
||||||
|
byChild.setSchoolid(deptId);
|
||||||
|
byChild.setCreateBy(operName);
|
||||||
|
this.insertByChild(byChild);
|
||||||
|
successNum++;
|
||||||
|
successMsg.append("<br/>" + successNum + "、幼儿 " + byChild.getName() + " 导入成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
failureNum++;
|
||||||
|
String msg = "<br/>" + failureNum + "、幼儿 " + byChild.getName() + " 导入失败:";
|
||||||
|
failureMsg.append(msg + e.getMessage());
|
||||||
|
log.error(msg, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (failureNum > 0) {
|
||||||
|
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||||
|
throw new CustomException(failureMsg.toString());
|
||||||
|
} else {
|
||||||
|
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||||
|
}
|
||||||
|
return successMsg.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ public class SchoolCommon {
|
|||||||
* 判断当前用户是否拥有班级
|
* 判断当前用户是否拥有班级
|
||||||
**/
|
**/
|
||||||
public String getClassId() {
|
public String getClassId() {
|
||||||
String strClassId = "-1";
|
// String strClassId = "-1";
|
||||||
SysUser sysUser = getUser();
|
SysUser sysUser = getUser();
|
||||||
ByClass byClass = new ByClass();
|
ByClass byClass = new ByClass();
|
||||||
//根据用户id来设置主班教师,配班教师,助理教师的教师id
|
//根据用户id来设置主班教师,配班教师,助理教师的教师id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user