Commit 295e5e91 by duxingshan

Merge remote-tracking branch 'origin/master'

parents 04788061 c66088e6
...@@ -10,9 +10,13 @@ spring: ...@@ -10,9 +10,13 @@ spring:
# username: root # username: root
# password: password # password: password
master: master:
url: jdbc:mysql://43.143.63.140:3306/school_platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true url: jdbc:mysql://1.116.38.25:3986/school_platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
username: root username: root
password: lbt@@18062367596 password: qianhe2022
# master:
# url: jdbc:mysql://43.143.63.140:3306/school_platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
# username: root
# password: lbt@@18062367596
# master: # master:
# url: jdbc:mysql://localhost:3306/school?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true # url: jdbc:mysql://localhost:3306/school?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
# username: root # username: root
......
...@@ -12,7 +12,7 @@ ruoyi: ...@@ -12,7 +12,7 @@ ruoyi:
profile: D:/ruoyi/uploadPath profile: D:/ruoyi/uploadPath
# profile: /home/ruoyi/uploadPath # profile: /home/ruoyi/uploadPath
#指定上传文件到哪个服务器,读取文件(本地选localhost,测试选47.105.176.202,试运行选10.20.100.201) #指定上传文件到哪个服务器,读取文件(本地选localhost,测试选47.105.176.202,试运行选10.20.100.201)
serverAddress: localhost:8848 serverAddress: http://192.168.1.109:8848
# serverAddress: http://47.105.176.202:8137 # serverAddress: http://47.105.176.202:8137
# serverAddress: http://10.20.100.201:57321 # serverAddress: http://10.20.100.201:57321
# 获取ip地址开关 # 获取ip地址开关
...@@ -88,20 +88,20 @@ spring: ...@@ -88,20 +88,20 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
# host: localhost host: localhost
host: 43.143.63.140 # host: 43.143.63.140
# host: 47.105.176.202 # host: 47.105.176.202
# host: 127.0.0.1 # host: 127.0.0.1
# 端口,默认为6379 # 端口,默认为6379
# port: 8134 # port: 8134
# port: 6379 port: 6379
port: 16379 # port: 16379
# port: 9121 # port: 9121
# 数据库索引 # 数据库索引
database: 11 database: 11
# 密码 # 密码
# password: password:
password: lbt18062367596 # password: lbt18062367596
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
......
<template>
<div class="app-container">
<el-form :model="queryForm" ref="queryForm" size="small" :inline="true" label-width="80px" @submit.native.prevent>
<el-form-item label="设备分类" prop="sbfl">
<el-select v-model="queryForm.sbfl" placeholder="请选择设备分类" clearable>
<el-option v-for="item in sbflOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="型号" prop="xh">
<el-input v-model="queryForm.xh" placeholder="请输入型号" clearable />
</el-form-item>
<el-form-item label="分类编码" prop="flbm">
<el-input v-model="queryForm.flbm" placeholder="请输入型号" clearable />
</el-form-item>
<el-form-item>
<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>
<el-row class="mb8" :gutter="10">
<el-col :span="1.5">
<el-button size="mini" type="primary" icon="el-icon-plus" @click="handleAdd"
v-hasPermi="['system:assets:remove']">新增
</el-button>
</el-col>
</el-row>
<!-- 表单数据 -->
<el-table v-if="refreshTable" :data="assetsList" v-loading="loading" row-key="id" :default-expand-all="isExpandAll"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column label="分类编码" header-align="center" prop="typeName"></el-table-column>
<el-table-column label="设备分类" align="center" prop="typeNum"></el-table-column>
<el-table-column label="型号" align="center" prop="typeOrder"></el-table-column>
<el-table-column label="管理员" align="center" prop="remark"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:assets:edit']">修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleLook(scope.row)"
v-hasPermi="['system:assets:edit']">查看
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:assets:remove']">删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 新增/修改弹出框 -->
<el-dialog width="800px" :visible.sync="open" :title="title" append-to-body @close="cancel">
<el-form ref="postForm" :model="postForm" :rules="rules" label-width="110px">
<el-row>
<el-col :span="10">
<el-form-item label="分类编码" prop="typeName">
<el-input v-model="postForm.typeName"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="设备分类" prop="typeNum">
<el-select v-model="postForm.typeNum" placeholder="请选择设备分类" clearable>
<el-option v-for="item in sbflOptions" :key="item.value" :label="item.label"
:value="item.value" :style="{ width: '206.66px' }" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="型号" prop="typeOrder">
<el-select v-model="postForm.typeOrder" placeholder="请选择型号" clearable>
<el-option v-for="item in xhOptions" :key="item.value" :label="item.label"
:value="item.value" :style="{ width: '100%' }" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="管理员" prop="licensePlate">
<el-input v-model="postForm.licensePlate" placeholder="请选择管理员" @focus="selectChange"
style="width: 100%"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 查看弹出框 -->
<el-dialog width="800px" :visible.sync="openLook" :title="title" append-to-body @close="cancel">
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-row>
<el-col :span="10">
<el-form-item label="分类编码" prop="typeName">
<el-input v-model="form.typeName"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="设备分类" prop="typeNum">
<el-select v-model="form.typeNum" placeholder="请选择设备分类" clearable>
<el-option v-for="item in sbflOptions" :key="item.value" :label="item.label"
:value="item.value" :style="{ width: '206.66px' }" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="型号" prop="typeOrder">
<el-select v-model="form.typeOrder" placeholder="请选择型号" clearable>
<el-option v-for="item in xhOptions" :key="item.value" :label="item.label"
:value="item.value" :style="{ width: '100%' }" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="管理员" prop="licensePlate">
<el-input v-model="form.licensePlate" placeholder="管理员" @focus="selectChange"
:disabled="isDisabled" style="width: 100%"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 选择管理员弹出框 -->
<el-dialog :title="title" :visible.sync="workableVehicle" width="960px" append-to-body>
<el-form :model="queryVehicleForm" inline @submit.native.prevent>
<el-form-item label="管理员">
<el-input v-model="queryVehicleForm.licensePlate" placeholder="请输入管理员"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQueryVehicle">搜索
</el-button>
<el-button plain size="small" icon="el-icon-refresh" @click="resetQueryVehicle">重置
</el-button>
</el-form-item>
</el-form>
<el-table :data="vehicleList" max-height="350" ref="vehicleSelectTable" @row-click="rowClick"
@selection-change="selectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="管理员" align="center" prop="licensePlate">
</el-table-column>
</el-table>
<ExPagination v-show="vehicleTotal > 0" :total="vehicleTotal" :page.sync="queryVehicleForm.pageNum"
:limit.sync="queryVehicleForm.pageSize" @pagination="getVehicleList"></ExPagination>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="selectVehicle" :disabled="!multi">确 定</el-button>
<el-button @click="abolish">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getVehicleList,
} from "@/api/smartSchool/personWork/vehicleApply";
import {
getClassList,
queryClass,
addClass,
editClass,
deleteClass
} from '@/api/smartSchool/logisticsManage/assetsClassification.js'
export default {
name: "AssetsClassification",
dicts: ["vehicle_type", "vehicle_state"],
data() {
return {
// 管理员列表总数
vehicleTotal: 0,
// 可选管理员列表
vehicleList: [],
// 管理员列表
queryVehicleForm: {
pageNum: 1,
pageSize: 10,
licensePlate: ''
},
// 是否显示选择管理员弹出层
workableVehicle: false,
// 是否禁用输入框
isDisabled: false,
//型号下拉框
xhOptions: [
{ value: '选项1', label: '1' },
{ value: '选项2', label: '2' },
{ value: '选项3', label: '3' },
{ value: '选项4', label: '4' },
{ value: '选项5', label: '5' }
],
queryForm: {
typeName: '',// 资产分类名称
typeNum: '',// 编号
typeOrder: '',// 排序号
remark: '',// 备注
},
form: {
typeName: '',// 资产分类名称
typeNum: '',// 编号
typeOrder: '',// 排序号
remark: '',// 备注
},
//设备分类下拉框
sbflOptions: [],
// 遮罩层
loading: false,
// 资产信息列表
assetsList: [],
// 新增/修改表单
postForm: {},
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
//查看弹出框
openLook: false,
// 多个禁用
multi: false,
// 展开
isExpandAll: true,
// 重新渲染表格状态
refreshTable: true,
// 校验规则
rules: {
typeName: [{ required: true, message: '资产分类不能为空', trigger: 'blur' }],
typeNum: [{ required: true, message: '资产编号不能为空', trigger: 'blur' }],
},
}
},
created() {
this.getList();
},
methods: {
//查询表单数据
getList() {
this.loading = true; // 加载效果
getClassList(this.queryForm).then(response => {
this.assetsList = this.handleTree(response.data, "id", 'pid', 'children');
this.loading = false;
})
},
// 可选管理员取消按钮
abolish() {
this.workableVehicle = false;
this.$nextTick(() => {
this.$refs.postForm.validateField('licensePlate');
})
},
// 选择管理员
selectVehicle() {
// 这里面就来给表单赋值
this.postForm.vehicleId = this.selectedCar.id;
this.$set(this.postForm, 'licensePlate', this.selectedCar.licensePlate);
// this.postForm.licensePlate = this.selectedCar.licensePlate;
this.abolish();
},
// 列表查询管理员列表
getVehicleList() {
this.vehicleLoading = true;
console.log('this.queryVehicleForm', this.queryVehicleForm)
this.$set(this.queryVehicleForm, 'vehicleState', 0)
getVehicleList(this.queryVehicleForm).then(response => {
this.vehicleLoading = false;
this.vehicleList = response.rows;
this.vehicleTotal = response.total;
}).catch(err => {
this.vehicleLoading = false;
})
},
// 查询管理员列表
handleQueryVehicle() {
this.throttle(() => {
this.getVehicleList();
})
},
rowClick(row) {
this.$refs.vehicleSelectTable.clearSelection();
this.$refs.vehicleSelectTable.toggleRowSelection(row, true);
},
// 选择管理员对话框选中数据
selectionChange(selection) {
this.selectedCar = selection[0];
this.multi = selection.length === 1;
},
// 查询管理员列表
handleQueryVehicle() {
this.throttle(() => {
this.getVehicleList();
})
},
// 重置管理员列表查询
resetQueryVehicle() {
this.queryVehicleForm = {
pageNum: 1,
pageSize: 10,
licensePlate: ''
};
this.handleQueryVehicle();
},
// 弹出选择管理员对话框
selectChange() {
this.workableVehicle = true;
this.handleQueryVehicle();
},
// 展开/折叠
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.$nextTick(() => {
this.refreshTable = true;
});
},
// 搜索
handleQuery() {
this.getList();
},
// 新增
handleAdd(row) {
this.reset();
if (row != null && row.id) {
this.postForm.pid = row.id;
} else {
this.postForm.pid = 0;
}
this.open = true;
this.title = "新增设备分类";
},
// 修改
handleUpdate(row) {
this.reset();
queryClass(row.id).then(response => {
this.postForm = response.data;
this.open = true;
this.title = "修改资产信息";
});
},
// 查看
handleLook(row) {
this.reset();
queryClass(row.id).then(response => {
this.form = response.data;
this.openLook = true;
this.title = "查看资产信息";
this.isDisabled = true;
});
},
// 删除
handleDelete(row) {
this.$modal.confirm(`是否确认删除此数据?`).then(() => {
this.loading = true;
return deleteClass(row.id);
}).then(() => {
this.getList();
this.loading = false;
this.$modal.msgSuccess("删除成功");
}).catch(() => {
this.loading = false
});
},
// 确定
submitForm() {
this.$refs["postForm"].validate(valid => {
if (valid) {
if (this.postForm.id != null) {
editClass(this.postForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addClass(this.postForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
// 取消
cancel() {
this.open = false;
this.openLook = false;
this.reset();
},
// 重置提交表单
reset() {
this.postForm = {
typeName: '',// 资产分类名称
typeNum: '',// 编号
typeOrder: '',// 排序号
remark: '',// 备注
};
this.resetForm('postForm')
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
}
}
}
</script>
<style></style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" v-show="showSearch" inline>
<el-form-item label="设备名称">
<el-input v-model="queryParams.equipmentName" @keyup.enter.native="handleQuery" clearable
placeholder="请输入设备名称"></el-input>
</el-form-item>
<el-form-item label="分类编码">
<el-input v-model="queryParams.equipmentCode" @keyup.enter.native="handleQuery" clearable
placeholder="请输入分类编码"></el-input>
</el-form-item>
<el-form-item label="设备状态">
<el-select v-model="queryParams.equipmentStatus" @keyup.enter.native="handleQuery" clearable
placeholder="请选择设备状态">
<el-option v-for="dict in dict.type.EquipmentStatus" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="归属类型">
<el-select v-model="queryParams.belongType" @keyup.enter.native="handleQuery" clearable
placeholder="请选择归属类型">
<el-option v-for="dict in dict.type.BelongType" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-button class="ml20" 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>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExportClass">导出
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" icon="el-icon-printer" size="mini" @click="printBarcodes">批量打印条码</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" stripe :data="ClassList" :cell-style="{ padding: '5px' }"
@selection-change="handleSelectionChange" width="100%">
<el-table-column type="selection" width="55" align="center" />
<el-table-column header-align="center" align="center" type="index" width="50" />
<el-table-column header-align="center" align="center" prop="equipmentCode" label="自编码" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="equipmentName" label="设备名称" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="equipmentModel" label="型号" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="equipmentSpec" label="规格" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="equipmentTypeCode" label="分类编码" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="equipmentUnit" label="单位" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="belongType" label="归属类型" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="equipmentStatus" label="设备状态" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="isAllowBorrow" label="是否允许借出" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="isBorrow" label="是否借出" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="productionDate" label="投产日期" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="equipmentPrice" label="价格(元)" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="usefulLife" label="效用年限(年)" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="equipmentPlace" label="地点" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="equipmentUser" label="使用人" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column header-align="center" align="center" prop="remark" label="备注" min-width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" align="center" min-width="250px" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:grade:edit']">编辑
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:grade:edit']">查看
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:grade:remove']">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 添加或修改学校班级对话框 -->
<el-dialog :title="title" :visible.sync="dialogVisibleforClass" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" :disabled="!isEdit" label-width="140px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="自编码:" prop="teacherName">
<el-input v-model="form.teacherName" placeholder="请输入自编码" clearable
@click.native="selectTeacher"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称:" prop="equipmentName">
<el-input v-model="form.equipmentName" placeholder="请输入设备名称" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="型号:" prop="equipmentModel">
<el-input v-model="form.equipmentModel" placeholder="请输入型号" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格:" prop="equipmentSpec">
<el-input v-model="form.equipmentSpec" placeholder="请输入规格" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="分类编码:" prop="equipmentType">
<el-input v-model="form.equipmentType" placeholder="请输入分类编码" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位:" prop="equipmentUnit">
<el-input v-model="form.equipmentUnit" placeholder="请输入单位" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="归属类型:" prop="equipmentBelongType">
<el-input v-model="form.equipmentBelongType" placeholder="请输入归属类型" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备状态:">
<el-select v-model="queryParams.equipmentStatus" @keyup.enter.native="handleQuery" clearable
placeholder="请选择设备状态">
<el-option v-for="dict in dict.type.EquipmentStatus" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="是否允许借出:" prop="equipmentIsBorrow">
<el-select v-model="queryParams.equipmentIsBorrow" @keyup.enter.native="handleQuery" clearable
placeholder="请选择是否允许借出">
<el-option v-for="dict in dict.type.EquipmentIsBorrow" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否借出:" prop="equipmentIsBorrow">
<el-select v-model="queryParams.equipmentIsBorrow" @keyup.enter.native="handleQuery" clearable
placeholder="请选择是否借出">
<el-option v-for="dict in dict.type.EquipmentIsBorrow" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="投产日期:" prop="equipmentProductionDate">
<el-date-picker v-model="form.equipmentProductionDate" type="date" placeholder="选择日期"
style="width: 100%;" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="价格:" prop="equipmentPrice">
<el-input v-model="form.equipmentPrice" placeholder="请输入价格" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="效用年限(年):" prop="equipmentUseYear">
<el-input v-model="form.equipmentUseYear" placeholder="请输入效用年限(年)" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="地点:" prop="equipmentAddress">
<el-input v-model="form.equipmentAddress" placeholder="请输入地点" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="使用人:" prop="equipmentUsePerson">
<el-input v-model="form.equipmentUsePerson" placeholder="请输入使用人" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注:" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button v-show="isEdit" type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">{{ !isEdit ? '退 出' : '取 消' }}</el-button>
</div>
</el-dialog>
<!-- 导入对话框-->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<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 text-center" slot="tip">
<span>仅允许导入xls、xlsx格式文件。</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">下载模板
</el-link>
</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>
</template>
<script>
import { getNewYear } from "@/api/smartSchool/teachAffairAdministration/affairClassView";
import {
getClassList,
getDetailInfo,
addClass,
editClass,
deleteClass,
allBY, editBatch,
} from "@/api/smartSchool/teachAffairAdministration/affairClassManage/index";
import TeacherSelect from '@/views/components/moduleComponets/TeacherSelect/index.vue'
import { teacherListInform } from "@/api/smartSchool/teacherManage/teacherInformation";
import PicAvatar from "@/views/smartSchool/schoolManage/introduce/schoolInfo/profile/picAvatar";
import { commonUpload } from "@/api/common";
import { getYearList } from "@/utils/utilLibrary/getYearList";
import { getToken } from "@/utils/auth";
import { TempGrades, TEXT_SIZE_ONE_HU, TEXT_SIZE_ONE_TH, TEXT_SIZE_TEL } from "@/enums/common";
export default {
name: "index",
dicts: ["Class", "Grade", "grade_type", "section_type"],
components: { TeacherSelect, PicAvatar },
data() {
return {
baseUrl: process.env.VUE_APP_BASE_API,
// 文本域
TEXT_SIZE_ONE_HU,
TEXT_SIZE_ONE_TH,
TEXT_SIZE_TEL,
//获取子组件传来的信息
pic: [],
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 学校班级表格数据
ClassList: [],
// 弹出层标题
title: "",
// 添加或修改学校班级对话框
dialogVisibleforClass: false,
// 批量操作对话框
dialogVisibleforBatch: false,
// 任课教师列表对话框
dialogVisibleForTeachers: false,
// 教师对话框标题
titleInform: '',
// 老师信息选择对话框
openTeacherInform: false,
// 班级导入参数
upload: {
// 是否显示弹出层(班级导入)
open: false,
// 弹出层标题(班级导入)
title: "",
// 是否禁用上传
isUploading: false,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/schoolClass/importData"
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
classValue: undefined,
gradeAlias: undefined,
houseName: undefined,
teacherName: undefined,
teacherTel: undefined,
isUsed: undefined,
schoolYear: new Date().getFullYear()
},
// 表单参数
form: {},
batchForm: {},
// 表单校验
rules: {
schoolYear: [{ required: true, message: '学年不能为空', trigger: 'change' }],
gradeValue: [{ required: true, message: '年级不能为空', trigger: 'change' }],
classValue: [{ required: true, message: '班级不能为空', trigger: 'change' }],
teacherName: [{ required: true, message: '班主任姓名不能为空', trigger: 'change' }],
teacherTel: [{ required: true, message: '班主任手机号不能为空', trigger: 'change' }],
houseName: [{ required: true, message: '所在教学楼不能为空', trigger: 'change' }],
classNum1: [{ required: true, message: '高一班级数量不能为空', trigger: 'blur' }],
classNum2: [{ required: true, message: '高二班级数量不能为空', trigger: 'blur' }],
classNum3: [{ required: true, message: '高三班级数量不能为空', trigger: 'blur' }],
// teacherWord: [{required: true, message: '寄语不能为空', trigger: 'blur'}],
},
// 任课教师列表表单
teachersListForm: {},
// 教师列表
teachersList: [],
// 新增或修改老师对话框
teacherPerForm: {},
// 控制表格属性的显示与隐藏
columns: [
{ key: 0, label: `班徽`, visible: true },
{ key: 1, label: `当前学年`, visible: true },
{ key: 2, label: `类型`, visible: false },
{ key: 3, label: `年级`, visible: true },
{ key: 4, label: `班级`, visible: true },
{ key: 5, label: `班级别名`, visible: true },
{ key: 6, label: `所在教学楼`, visible: true },
{ key: 7, label: `班主任姓名`, visible: true },
{ key: 8, label: `班主任手机号`, visible: true },
{ key: 9, label: `班级口号`, visible: true },
{ key: 10, label: `班主任寄语`, visible: false },
{ key: 11, label: `是否毕业`, visible: true },
{ key: 12, label: `备注`, visible: false },
],
// 选择老师对话框
teacherOptions: {
open: false,
title: '选择老师'
},
// 上传图片的加载效果
uploadLoading: false,
// imageUrl: '',
// 年份列表数据
yearList: [],
// 表单是否可以修改、
isEdit: true,
};
},
created() {
this.yearList = getYearList();
//获取最新年份
this.newYear()
},
computed: {
resolveClassName() {
return form => {
// const result = ['*', '*', '*'];
const result = [];
const { classValue, gradeValue, schoolYear } = form;
classValue && (result[1] = this.dict.type.Class.find(item => item.value == classValue).label);
gradeValue && (result[0] = TempGrades.find(item => item.value == gradeValue).label);
// schoolYear && (result[0] = schoolYear);
form.gradeName = result[0];
form.className = result[1];
form.classAlias = result.join('');
return form.classAlias;
}
}
},
watch: {
'form.schoolYear'(val) {
this.form.schoolYear = '' + val;
},
pic: {
handler(newValue, oldValue) {
this.isUploadPic = newValue[3]
}
}
},
methods: {
schoolYearChange() {
console.log("日期改变", this.form.schoolYear)
},
newYear() {
getNewYear().then((res) => {
this.queryParams.schoolYear = res.schoolYear
this.handleQuery();
})
},
/** 查询学校班级列表 */
getList() {
this.loading = true;
getClassList(this.queryParams).then((response) => {
this.ClassList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.dialogVisibleforClass = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
picUrl: '',
schoolYear: '',
classNum1: 0,
classNum2: 0,
classNum3: 0,
gradeValue: '',
classValue: '',
classAlias: '',
teacherName: '',
houseName: '',
remark: '',
teacherTel: '',
classSlogan: '',
teacherWord: ''
};
// this.imageUrl = '';
//表单可编辑
this.isEdit = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
classValue: undefined,
classAlias: undefined,
houseName: undefined,
teacherName: undefined,
teacherTel: undefined,
isUsed: undefined,
};
this.newYear();
//
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
//获取图片信息
getClassInfoPic(val) {
this.pic = val
},
/** 新增班级按钮操作 */
handleAdd() {
this.reset();
this.dialogVisibleforClass = true;
this.title = "添加班级信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
this.$modal.loading('正在加载数据,请稍等...');
getDetailInfo(id).then((response) => {
this.$modal.closeLoading();
this.form = response.data;
this.dialogVisibleforClass = true;
this.title = "修改班级信息";
}).catch(error => {
this.$modal.closeLoading();
})
},
/** 查看详情 */
handleDetail(row) {
this.reset();
const id = row.id || this.ids;
this.$modal.loading('正在加载数据,请稍等...');
getDetailInfo(id).then(response => {
this.$modal.closeLoading();
this.form = response.data;
this.dialogVisibleforClass = true;
this.title = "班级详情";
this.isEdit = false;
}).catch(error => {
this.$modal.closeLoading();
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
// 将年级和班级信息赋值
this.handleBaseInfo();
this.$modal.loading('正在上传数据,请稍等...');
if (this.form.id != null) {
editClass(this.form).then((response) => {
this.$modal.closeLoading();
this.$modal.msgSuccess("修改班级成功");
this.dialogVisibleforClass = false;
this.getList();
}).catch(error => {
this.$modal.closeLoading();
})
} else {
addClass({
...this.form,
gradeType: 4
}).then((response) => {
this.$modal.closeLoading();
this.$modal.msgSuccess("新增班级成功");
this.dialogVisibleforClass = false;
this.getList();
}).catch(error => {
this.$modal.closeLoading();
})
}
}
});
},
handleBaseInfo() {
this.form.gradeName = this.dict.type.Grade.find(item => item.value == this.form.gradeValue).label;
this.form.className = this.dict.type.Class.find(item => item.value == this.form.classValue).label;
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除所选班级?').then(() => {
this.$modal.loading('正在删除,请稍等...');
return deleteClass(ids);
}).then(response => {
this.$modal.closeLoading();
this.$modal.msgSuccess("删除班级成功");
this.getList();
}).catch(error => {
this.$modal.closeLoading();
})
},
// // 批量毕业
// handleGraduation() {
// allBY(this.ids).then((reponse) => {
// this.$modal.msgSuccess("操作成功");
// this.getList();
// });
// },
// 批量打印
printBarcodes() {
// this.$modal.confirm('是否确认打印所选班级条码?').then(() => {
// this.$modal.loading('正在打印,请稍等...');
// return printBarcodes(this.ids);
// }).then(response => {
// this.$modal.closeLoading();
// this.$modal.msgSuccess("打印成功");
// this.getList();
// }).catch(error => {
// this.$modal.closeLoading();
// })
},
// 取消按钮
cancelForBatch() {
this.dialogVisibleforBatch = false;
this.reset();
},
submitFormForBatch() {
console.log("点击提交")
this.$refs["form"].validate((valid) => {
if (valid) {
this.$modal.loading('正在上传数据,请稍等...');
editBatch(this.form).then((response) => {
this.$modal.closeLoading();
this.$modal.msgSuccess("批量修改成功");
this.dialogVisibleforBatch = false;
this.getList();
}).catch(error => {
this.$modal.closeLoading();
})
}
});
},
// 下载班级模板
importTemplate() {
this.download(
"/schoolClass/importTemplate",
{},
`班级管理.xlsx`
);
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "班级导入";
this.upload.open = true;
},
/** 导出班级按钮操作 */
handleExportClass() {
const length = this.ids.length;
const ids = this.ids;
if (!length) {
this.download(
"/schoolClass/export",
{
...this.queryParams,
},
`班级管理.xlsx`
);
} else {
this.download(
"/schoolClass/export/" + ids,
{
...this.queryParams,
},
`class_${new Date().getTime()}.xlsx`
);
}
},
// 获取教师信息
teacherInfoList() {
this.teacherOptions.open = true;
},
/** 选择老师(打开对话框) */
selectTeacher() {
this.teacherOptions.open = true;
},
/** 获取老师信息列表 */
getTeacherList(queryForm, callback) {
teacherListInform({ ...queryForm, employeeType: 0 }).then(response => {
callback(response.rows, response.total);
}).catch(error => {
callback([], 0);
})
},
/** 设置老师信息 */
setTeacherInfo(item) {
// this.form.teacherName = item.teacherName;
this.$set(this.form, 'teacherName', item.teacherName);
this.$set(this.form, 'teacherTel', item.teacherTel);
this.$set(this.form, 'teacherId', item.id);
},
// 任课教师列表
teachersListEdit(row) {
this.$router.push({
path: "/jwClassManage/teacherlists",
query: {
gradeId: row.id,
routeBack: 0
},
});
},
// 是否毕业按钮切换
changeSwitch(row) {
// const ids=this.ids||row.id
let text = row.isGraduated === "1" ? "毕业" : "取消毕业";
this.$modal.confirm('确认要' + text + '"' + row.classAlias + '"班级吗?').then(function () {
return allBY(row.id, row.isGraduated);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function () {
row.isGraduated = row.isGraduated === "0" ? "1" : "0";
});
},
// 图片上传功能
uploadImage(file) {
const fileData = file.file;
const formData = new FormData();
formData.append('file', fileData);
this.uploadLoading = true;
commonUpload(formData).then(response => {
this.uploadLoading = false;
this.$modal.msgSuccess('上传成功');
// this.imageUrl = this.baseUrl + response.fileName;
this.form.picUrl = response.fileName;
}).catch(error => {
this.uploadLoading = false;
})
},
// 上传图片之前的钩子函数
beforeAvatarUpload() {
},
// 上传成功
handleAvatarSuccess() {
},
/** 上传过程 */
handleFileUploadProgress() {
this.upload.isUploading = true;
},
/** 上传成功 */
handleFileSuccess(response) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
/** 提交 */
submitFileForm() {
this.$refs.upload.submit();
}
},
};
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备名称" prop="failureEquipment">
<el-input v-model="queryParams.failureEquipment" placeholder="请输入设备名称" clearable></el-input>
</el-form-item>
<el-form-item label="分类编码" prop="failureEquipmentCode">
<el-input v-model="queryParams.failureEquipmentCode" placeholder="请输入分类编码" clearable></el-input>
</el-form-item>
<el-form-item label="修理结果" prop="maintainResult">
<el-select v-model="queryParams.maintainResult" placeholder="修理结果" clearable>
<el-option v-for="dict in dict.type.
maintain_result" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="维修状态" prop="maintainState">
<el-select v-model="queryParams.maintainState" placeholder="维修状态" clearable>
<el-option v-for="dict in dict.type.
maintain_state" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
<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>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:application:add']">新增
</el-button>
</el-col>
</el-row>
<!-- 表格数据 -->
<el-table :data="applyTable" style="width: 100%" :header-cell-style="{ background: '#f6f9fe' }">
<el-table-column align="center" type="index" label="序号" width="50px" />
<el-table-column align="center" prop="id" label="自编码" width="130px" />
<el-table-column align="center" prop="repairsName" label="设备名称" width="85px" />
<el-table-column align="center" prop="phone" label="型号" width="130px" />
<el-table-column align="center" prop="repairsTime" label="投产日期" width="160px" />
<el-table-column align="center" prop="failureEquipment" label="地点" width="160px" />
<el-table-column align="center" prop="failureEquipmentArea" label="问题" width="160px" />
<el-table-column align="center" prop="failureEquipmentDescribe" label="修理人" width="150px" />
<el-table-column align="center" prop="maintainResult" label="修理时间" width="100px" />
<el-table-column align="center" prop="maintainState" label="修理结果" width="100px">
<template slot-scope="{ row }">
{{ row.maintainState == 1 ? "未接单" : row.maintainState == 2 ? "维修中" : "已维修 " }}
</template>
</el-table-column>
<el-table-column align="center" prop="maintainState" label="处理状态" width="100px">
<template slot-scope="{ row }">
{{ row.maintainState == 1 ? "未接单" : row.maintainState == 2 ? "维修中" : "已维修 " }}
</template>
</el-table-column>
<el-table-column align="center" prop="maintainState" label="评价" width="160px">
<template>
<el-rate v-model="form.evaluate" :max="5"></el-rate>
</template>
</el-table-column>
<el-table-column label="操作" width="180px" class-name="small-padding fixed-width">
<template slot-scope="{ row }">
<div>
<el-button size="mini" type="text" icon="el-icon-search" @click="handleLook(row)">
查看
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(row)"
v-hasPermi="['system:application:remove']">
修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(row)"
v-hasPermi="['system:application:remove']">
删除
</el-button>
</div>
</template>
</el-table-column>
</el-table>
<!-- 新增/修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body @close="cancel">
<el-form ref="postForm" :model="postForm" :rules="rules" label-width="110px">
<el-row>
<el-col :span="12">
<el-form-item label="自编码" prop="id">
<el-input v-model="postForm.id" placeholder="报修单号"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报修人" prop="repairsName">
<el-input v-model="postForm.repairsName" placeholder="报修人"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="设备名称" prop="repairsName">
<el-input v-model="postForm.repairsName" placeholder="设备名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="问题" prop="repairsName">
<el-input v-model="postForm.repairsName" placeholder="问题"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="型号" prop="repairsName">
<el-input v-model="postForm.repairsName" placeholder="型号"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维修人" prop="repairsName">
<el-select v-model="postForm.typeNum" placeholder="请选择维修人" clearable>
<el-option v-for="item in sbflOptions" :key="item.value" :label="item.label"
:value="item.value" :style="{ width: '100%' }" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="投产日期:" prop="equipmentProductionDate">
<el-date-picker v-model="form.equipmentProductionDate" type="date" placeholder="选择日期"
style="width: 100%;" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维修时间:" prop="equipmentProductionDate">
<el-date-picker v-model="form.equipmentProductionDate" type="date" placeholder="选择日期"
style="width: 100%;" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="地点" prop="Address">
<el-input v-model="form.Address" placeholder="地点" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="修理状态" prop="repairStatus">
<el-select v-model="form.repairStatus" placeholder="请选择" clearable>
<el-option v-for="item in repairStatusOptions" :key="item.value" :label="item.label"
:value="item.value" :style="{ width: '100%' }" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="报修时间:" prop="equipmentProductionDate">
<el-date-picker v-model="form.equipmentProductionDate" type="date" placeholder="选择日期"
style="width: 100%;" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="评价" prop="phevaluateone">
<el-rate v-model="formfk.evaluate" :max="5"></el-rate>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="form.remark" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="text-align: center">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 查看对话框 -->
<el-dialog :title="title" :visible.sync="openLook" width="1200px" append-to-body @close="cancel">
<el-form ref="postForm" :model="postForm" :rules="rules" label-width="110px">
<el-row>
<el-col :span="12">
<el-form-item label="自编码" prop="id">
<el-input v-model="postForm.id" placeholder="报修单号"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报修人" prop="repairsName">
<el-input v-model="postForm.repairsName" placeholder="报修人"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="设备名称" prop="repairsName">
<el-input v-model="postForm.repairsName" placeholder="设备名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="问题" prop="repairsName">
<el-input v-model="postForm.repairsName" placeholder="问题"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="型号" prop="repairsName">
<el-input v-model="postForm.repairsName" placeholder="型号"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维修人" prop="repairsName">
<el-select v-model="postForm.repairsName" placeholder="请选择维修人" clearable>
<el-option v-for="item in sbflOptions" :key="item.value" :label="item.label"
:value="item.value" :style="{ width: '100%' }" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="投产日期:" prop="equipmentProductionDate">
<el-date-picker v-model="form.equipmentProductionDate" type="date" placeholder="选择日期"
style="width: 100%;" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维修时间:" prop="equipmentProductionDate">
<el-date-picker v-model="form.equipmentProductionDate" type="date" placeholder="选择日期"
style="width: 100%;" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="地点" prop="Address">
<el-input v-model="form.Address" placeholder="地点" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="修理状态" prop="repairStatus">
<el-select v-model="form.repairStatus" placeholder="请选择" clearable>
<el-option v-for="item in repairStatusOptions" :key="item.value" :label="item.label"
:value="item.value" :style="{ width: '100%' }" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="报修时间:" prop="equipmentProductionDate">
<el-date-picker v-model="form.equipmentProductionDate" type="date" placeholder="选择日期"
style="width: 100%;" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="评价" prop="phevaluateone">
<el-rate v-model="formfk.evaluate" :max="5"></el-rate>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="form.remark" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="text-align: center">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList"></pagination>
</div>
</template>
<script>
import {
listRepairs,// 查询报修列表
addRepairs,// 新增报修信息
getRepairs,// 查询报修信息详情
updateRepairs, // 修改报修信息
delRepairs,// 删除报修信息
submitRepairs,//反馈结果接口
numberRepairs,//获取报修单号
} from "@/api/smartSchool/personWork/logisticsWarranty";
export default {
name: 'logisticsWarranty',
dicts: ['maintain_state'],
data() {
return {
sbflOptions: {
},
repairStatusOptions: {
},
maintainState: '',
queryParams: {
id: "",
repairsTime: "",
maintainState: "",
pageNum: 1,
pageSize: 10,
},
// 表格数据
applyTable: [],
// 查询表单
queryForm: {
pageNum: 1,
pageSize: 10,
},
// 遮罩层
loading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 是否只读
readonly: false,
// 多个禁用
multi: false,
// 显示搜索条件
showSearch: true,
// 信息列表
infoList: [],
// 数据总数
total: 0,
// 新增/修改表单
postForm: {
},
// 反馈结果
formfk: {
id: "",
maintainResult: "",
maintainState: "3",
evaluate: "",
},
// 是否显示新增弹出层
open: false,
// 查看对话框
openLook: false,
// // 表单校验
rules: {
phone: [
{ required: true, message: "联系方式不能为空", trigger: "blur" }
],
repairsTime: [
{ required: true, message: "保修时间不能为空", trigger: "blur" }
],
failureEquipment: [
{ required: true, message: "故障设备不能为空", trigger: "blur" }
],
failureEquipmentArea: [
{ required: true, message: "故障设备地点不能为空", trigger: "blur" }
],
failureEquipmentDescribe: [
{ required: true, message: "故障设备描述", trigger: "blur" }
],
},
// 弹出层标题
title: '',
form: {
id: "",
maintainResult: "",
evaluate: "",
}
}
},
mounted() {
this.formfk.evaluate = 5;
},
created() {
this.getList();
},
methods: {
/** 获取列表数据 */
getList() {
listRepairs(this.queryParams).then(response => {
this.loading = false;
this.applyTable = response.rows;
console.log('this.applyTable', this.applyTable);
this.total = response.total;
}).catch(err => {
this.loading = false;
})
},
// 搜索按钮
handleQuery() {
this.throttle(() => {
this.queryForm.pageNum = 1;
this.getList();
})
},
/** 查看 */
handleLook(row) {
this.form = row;
const id = row.id || this.ids;
getRepairs(id).then(response => {
this.form = response.data;
console.log('this.form', this.form);
this.openLook = true;
}).catch(err => {
})
this.title = "查看报修情况";
},
// 重置按钮
resetQuery() {
this.queryParams = {
id: "",
repairsTime: null,
pageNum: 1,
pageSize: 10,
}
this.handleQuery(); // 重新发一次请求
},
// 新增按钮操作
handleAdd() {
this.reset();
numberRepairs().then((response) => {
this.postForm.id = response.data.id;
console.log('this.postForm.id', this.postForm.id);
this.postForm.repairsName = this.$store.state.user.name;
this.postForm.phone = this.$store.state.user.teacher.teacherTel;
console.log(123, this.postForm.repairsName);
console.log(123, this.postForm.phone);
// 设置 isNew 为 true,表示当前是新增操作
this.isNew = true;
this.open = true;
this.title = "添加申请";
});
},
// 修改按钮操作
handleUpdate(row) {
const id = row.id || this.ids;
this.title = "修改申请";
getRepairs(id).then(response => {
this.postForm = response.data;
this.open = true;
}).catch(err => {
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除"' + ids + '"的数据项?').then(function () {
return delRepairs(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
// 提交表单
submitForm() {
this.throttle(() => {
this.$refs["postForm"].validate(valid => {
if (valid) {
this.$modal.loading('正在上传数据,请稍等...');
if (this.isNew) {
// 新增操作
addRepairs(this.postForm).then(response => {
this.$modal.closeLoading();
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).catch(err => {
this.$modal.closeLoading();
});
} else {
// 修改操作
updateRepairs(this.postForm).then(response => {
this.$modal.closeLoading();
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).catch(err => {
this.$modal.closeLoading();
});
}
}
});
})
},
// 取消按钮
cancel() {
this.open = false;
this.openLook = false;
// this.resetQuery();
this.reset();
},
reset() {
// 这里需要重置对话框表单
this.postForm = {
};
this.resetForm('postForm');
},
}
}
</script>
<style>
.hidden-item {
display: none;
}
</style>
...@@ -56,7 +56,7 @@ public class CurriCulaVariableController extends BaseController { ...@@ -56,7 +56,7 @@ public class CurriCulaVariableController extends BaseController {
*/ */
@PostMapping("/edit") @PostMapping("/edit")
public AjaxResult edit(@RequestBody CurriculaVariable curriculaVariable){ public AjaxResult edit(@RequestBody CurriculaVariable curriculaVariable){
return toAjax(curriculaVariableService.updateById(curriculaVariable)); return toAjax(curriculaVariableService.updateCurriculaVariable(curriculaVariable));
} }
/** /**
...@@ -67,4 +67,14 @@ public class CurriCulaVariableController extends BaseController { ...@@ -67,4 +67,14 @@ public class CurriCulaVariableController extends BaseController {
public AjaxResult getNewGrade(){ public AjaxResult getNewGrade(){
return AjaxResult.success(curriculaVariableService.getNewGrade()); return AjaxResult.success(curriculaVariableService.getNewGrade());
} }
/**
* 获取班级下拉框
* @param grade
* @return
*/
@GetMapping("/selectClass")
public AjaxResult selectClass(@RequestParam("grade") String grade){
return AjaxResult.success(curriculaVariableService.selectClass(grade));
}
} }
\ No newline at end of file
...@@ -5,15 +5,18 @@ import com.ruoyi.common.core.controller.BaseController; ...@@ -5,15 +5,18 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictDataService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yangtz.cs.liu.campus.service.curricula.ICurriculaStudentService; import yangtz.cs.liu.campus.service.curricula.ICurriculaStudentService;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentCjVo;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo; import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentXjVo;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentYtVo;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -25,6 +28,8 @@ public class CurriculaStudentController extends BaseController { ...@@ -25,6 +28,8 @@ public class CurriculaStudentController extends BaseController {
@Autowired @Autowired
private ICurriculaStudentService curriculaStudentService; private ICurriculaStudentService curriculaStudentService;
@Autowired
private ISysDictDataService sysDictDataService;
/** /**
* 查看选课情况列表 * 查看选课情况列表
...@@ -38,28 +43,144 @@ public class CurriculaStudentController extends BaseController { ...@@ -38,28 +43,144 @@ public class CurriculaStudentController extends BaseController {
} }
/** /**
* 查看春季选课情况列表
* @param curriculaStudentVo
* @return
*/
@GetMapping("/listCj")
public TableDataInfo listCj(CurriculaStudentVo curriculaStudentVo){
startPage();
return getDataTable(curriculaStudentService.selectCurriculaStudentListCj(curriculaStudentVo));
}
/**
* 查看夏季选课情况列表
* @param curriculaStudentVo
* @return
*/
@GetMapping("/listXj")
public TableDataInfo listXj(CurriculaStudentVo curriculaStudentVo){
startPage();
return getDataTable(curriculaStudentService.selectCurriculaStudentListXj(curriculaStudentVo));
}
/**
* 查看艺体选课情况列表
* @param curriculaStudentVo
* @return
*/
@GetMapping("/listYt")
public TableDataInfo listYt(CurriculaStudentVo curriculaStudentVo){
startPage();
return getDataTable(curriculaStudentService.selectCurriculaStudentListYt(curriculaStudentVo));
}
/**
* 导出选课情况列表 * 导出选课情况列表
*/ */
@Log(title = "选课情况", businessType = BusinessType.EXPORT) @Log(title = "选课情况", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, CurriculaStudentVo curriculaStudentVo) public void export(HttpServletResponse response,CurriculaStudentVo curriculaStudentVo)
{ {
List<CurriculaStudentVo> list = curriculaStudentService.selectCurriculaStudentList(curriculaStudentVo); List<CurriculaStudentVo> list = curriculaStudentService.selectCurriculaStudentList(curriculaStudentVo);
list.forEach(curriculaStudentVo1 -> { // list.forEach(curriculaStudentVo1 -> {
if (null != curriculaStudentVo1.getSelectedMajor() && "".equals(curriculaStudentVo1.getSelectedMajor())){ // if(null == curriculaStudentVo1.getSelectedMajor() || "".equals(curriculaStudentVo1.getSelectedMajor())){
String[] split = curriculaStudentVo1.getSelectedMajor().split(","); //
String selectedMajorName = ""; // }else {
for (int i=0;i<split.length;i++) { // String[] split = curriculaStudentVo1.getSelectedMajor().split(",");
if (i == split.length - 1){ // String selectedMajorName = "";
selectedMajorName += curriculaStudentService.selectZyZd(split[i]) + ","; // for (int i=0;i<split.length;i++) {
}else { // if (i == split.length - 1){
selectedMajorName += curriculaStudentService.selectZyZd(split[i]); // selectedMajorName += sysDictDataService.selectDictLabel(split[i],"specialty") + ",";
// }else {
// selectedMajorName += sysDictDataService.selectDictLabel(split[i],"specialty");
// }
// }
// curriculaStudentVo1.setSelectedMajorName(selectedMajorName);
// }
// });
for (CurriculaStudentVo studentVo : list) {
if (null != studentVo.getSelectedMajor()){
if (studentVo.getSelectedMajor().length() > 0){
String[] split = studentVo.getSelectedMajor().split(",");
String selectedMajorName = "";
for (int i=0;i<split.length;i++) {
if (i == split.length - 1){
selectedMajorName += sysDictDataService.selectDictLabel("specialty",split[i]);
}else {
selectedMajorName += sysDictDataService.selectDictLabel("specialty",split[i])+ ",";
}
} }
studentVo.setSelectedMajorName(selectedMajorName);
} }
curriculaStudentVo1.setSelectedMajorName(selectedMajorName);
} }
}); }
ExcelUtil<CurriculaStudentVo> util = new ExcelUtil<CurriculaStudentVo>(CurriculaStudentVo.class); ExcelUtil<CurriculaStudentVo> util = new ExcelUtil<CurriculaStudentVo>(CurriculaStudentVo.class);
util.exportExcel(response, list, "选课情况数据"); util.exportExcel(response, list, "选课情况数据");
} }
/**
* 导出春季选课情况列表
*/
@Log(title = "春季选课情况", businessType = BusinessType.EXPORT)
@PostMapping("/exportCj")
public void exportCj(HttpServletResponse response,CurriculaStudentVo curriculaStudentVo)
{
List<CurriculaStudentVo> curriculaStudentVoList = curriculaStudentService.selectCurriculaStudentListCj(curriculaStudentVo);
List<CurriculaStudentCjVo> list = new ArrayList<>();
curriculaStudentVoList.forEach(curriculaStudentVo1 -> {
CurriculaStudentCjVo studentCjVo = new CurriculaStudentCjVo();
//已选专业
String[] split = curriculaStudentVo1.getSelectedMajor().split(",");
String selectedMajorName = "";
for (int i=0;i<split.length;i++) {
if (i == split.length - 1){
selectedMajorName += sysDictDataService.selectDictLabel("specialty",split[i]);
}else {
selectedMajorName += sysDictDataService.selectDictLabel("specialty",split[i]) + ",";
}
}
curriculaStudentVo1.setSelectedMajorName(selectedMajorName);
BeanUtils.copyProperties(curriculaStudentVo1,studentCjVo);
list.add(studentCjVo);
});
ExcelUtil<CurriculaStudentCjVo> util = new ExcelUtil<CurriculaStudentCjVo>(CurriculaStudentCjVo.class);
util.exportExcel(response, list, "选课情况数据");
}
/**
* 导出夏季选课情况列表
*/
@Log(title = "夏季选课情况", businessType = BusinessType.EXPORT)
@PostMapping("/exportXj")
public void exportXj(HttpServletResponse response,CurriculaStudentVo curriculaStudentVo)
{
List<CurriculaStudentVo> curriculaStudentVoList = curriculaStudentService.selectCurriculaStudentListXj(curriculaStudentVo);
List<CurriculaStudentXjVo> list = new ArrayList<>();
curriculaStudentVoList.forEach(curriculaStudentVo1 -> {
CurriculaStudentXjVo curriculaStudentXjVo = new CurriculaStudentXjVo();
BeanUtils.copyProperties(curriculaStudentVo1,curriculaStudentXjVo);
list.add(curriculaStudentXjVo);
});
ExcelUtil<CurriculaStudentXjVo> util = new ExcelUtil<CurriculaStudentXjVo>(CurriculaStudentXjVo.class);
util.exportExcel(response, list, "选课情况数据");
}
/**
* 导出艺体选课情况列表
*/
@Log(title = "艺体选课情况", businessType = BusinessType.EXPORT)
@PostMapping("/exportYt")
public void exportYt(HttpServletResponse response,CurriculaStudentVo curriculaStudentVo)
{
List<CurriculaStudentVo> curriculaStudentVoList = curriculaStudentService.selectCurriculaStudentListYt(curriculaStudentVo);
List<CurriculaStudentYtVo> list = new ArrayList<>();
curriculaStudentVoList.forEach(curriculaStudentVo1 -> {
CurriculaStudentYtVo curriculaStudentYtVo = new CurriculaStudentYtVo();
BeanUtils.copyProperties(curriculaStudentVo1,curriculaStudentYtVo);
list.add(curriculaStudentYtVo);
});
ExcelUtil<CurriculaStudentYtVo> util = new ExcelUtil<CurriculaStudentYtVo>(CurriculaStudentYtVo.class);
util.exportExcel(response, list, "选课情况数据");
}
} }
...@@ -5,12 +5,8 @@ import com.ruoyi.common.core.domain.AjaxResult; ...@@ -5,12 +5,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass;
import yangtz.cs.liu.campus.domain.student.SchoolStudentScore; import yangtz.cs.liu.campus.domain.student.SchoolStudentScore;
import yangtz.cs.liu.campus.service.curricula.IStudentScoreService; import yangtz.cs.liu.campus.service.curricula.IStudentScoreService;
import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo; import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
...@@ -28,6 +24,11 @@ public class StudentScoreController extends BaseController { ...@@ -28,6 +24,11 @@ public class StudentScoreController extends BaseController {
@Autowired @Autowired
private IStudentScoreService studentScoreService; private IStudentScoreService studentScoreService;
/**
* 查看成绩管理列表
* @param schoolStudentScoreVo
* @return
*/
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SchoolStudentScoreVo schoolStudentScoreVo){ public TableDataInfo list(SchoolStudentScoreVo schoolStudentScoreVo){
startPage(); startPage();
...@@ -52,13 +53,64 @@ public class StudentScoreController extends BaseController { ...@@ -52,13 +53,64 @@ public class StudentScoreController extends BaseController {
* @throws Exception * @throws Exception
*/ */
@PostMapping("/importData") @PostMapping("/importData")
public AjaxResult importData(MultipartFile file) throws Exception { public AjaxResult importData(MultipartFile file,Long curriculaId) throws Exception {
ExcelUtil<SchoolStudentScoreVo> util = new ExcelUtil<SchoolStudentScoreVo>(SchoolStudentScoreVo.class); ExcelUtil<SchoolStudentScoreVo> util = new ExcelUtil<SchoolStudentScoreVo>(SchoolStudentScoreVo.class);
List<SchoolStudentScoreVo> list = util.importExcel(file.getInputStream()); List<SchoolStudentScoreVo> list = util.importExcel(file.getInputStream());
//校验 //校验
studentScoreService.checkImport(list); studentScoreService.checkImport(list);
//导入 //导入
String message = studentScoreService.importExamDetail(list); String message = studentScoreService.importExamDetail(list,curriculaId);
return AjaxResult.success(message); return AjaxResult.success(message);
} }
/**
* 根据身份证号查询学生信息
* @param idCard
* @return
*/
@GetMapping("/selectStudent")
public AjaxResult selectStudent(@RequestParam("idCard") String idCard){
return AjaxResult.success(studentScoreService.selectStudent(idCard));
}
/**
* 查询学生成绩详细信息
* @param id
* @return
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(studentScoreService.selectStudentScoreById(id));
}
/**
* 新增学生成绩信息
* @param schoolStudentScore
* @return
*/
@PostMapping("/add")
public AjaxResult add(@RequestBody SchoolStudentScore schoolStudentScore){
return toAjax(studentScoreService.insertStudentScore(schoolStudentScore));
}
/**
* 修改学生成绩信息
* @param schoolStudentScore
* @return
*/
@PutMapping("/edit")
public AjaxResult edit(@RequestBody SchoolStudentScore schoolStudentScore){
return toAjax(studentScoreService.updateStudentScore(schoolStudentScore));
}
/**
* 批量删除学生成绩信息
* @param ids
* @return
*/
@DeleteMapping("/delete/{ids}")
public AjaxResult delete(@PathVariable Long[] ids){
return toAjax(studentScoreService.deleteStudentScore(ids));
}
} }
...@@ -25,11 +25,11 @@ public class CurriculaStudent { ...@@ -25,11 +25,11 @@ public class CurriculaStudent {
/** 选课状态(1-未选课,2-已选课) */ /** 选课状态(1-未选课,2-已选课) */
private String curriculaState; private String curriculaState;
/** 已选课程 */ /** 已选课程 */
private Integer selectedCourse; private String selectedCourse;
/** 已选专业 */ /** 已选专业 */
private String selectedMajor; private String selectedMajor;
/** 所选科目 */ /** 所选科目 */
private Integer selectedSubject; private String selectedSubject;
/** 是否删除 */ /** 是否删除 */
private String delFalg; private String delFalg;
} }
...@@ -18,22 +18,22 @@ public class SchoolStudentScore extends OurBaseEntity { ...@@ -18,22 +18,22 @@ public class SchoolStudentScore extends OurBaseEntity {
/** 考试类型 */ /** 考试类型 */
private String examType; private String examType;
/** 语文 */ /** 语文 */
private Integer language; private double language;
/** 数学 */ /** 数学 */
private Integer math; private double math;
/** 英语 */ /** 英语 */
private Integer english; private double english;
/** 政治 */ /** 政治 */
private Integer politics; private double politics;
/** 地理 */ /** 地理 */
private Integer geography; private double geography;
/** 历史 */ /** 历史 */
private Integer history; private double history;
/** 物理 */ /** 物理 */
private Integer physics; private double physics;
/** 化学 */ /** 化学 */
private Integer chemistry; private double chemistry;
/** 生物 */ /** 生物 */
private Integer biology; private double biology;
} }
...@@ -25,9 +25,23 @@ public interface CurriculaStudentMapper extends BaseMapper<CurriculaStudent> { ...@@ -25,9 +25,23 @@ public interface CurriculaStudentMapper extends BaseMapper<CurriculaStudent> {
List<CurriculaStudentVo> selectCurriculaStudentList(CurriculaStudentVo curriculaStudentVo); List<CurriculaStudentVo> selectCurriculaStudentList(CurriculaStudentVo curriculaStudentVo);
/** /**
* 查询专业字典 * 查看春季选课情况列表
* @param dictValue * @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentListCj(CurriculaStudentVo curriculaStudentVo);
/**
* 查看夏季选课情况列表
* @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentListXj(CurriculaStudentVo curriculaStudentVo);
/**
* 查看艺体选课情况列表
* @param curriculaStudentVo
* @return * @return
*/ */
String selectZyZd(@Param("dictValue") String dictValue); List<CurriculaStudentVo> selectCurriculaStudentListYt(CurriculaStudentVo curriculaStudentVo);
} }
...@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param; ...@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.curricula.CurriculaVariable; import yangtz.cs.liu.campus.domain.curricula.CurriculaVariable;
import java.util.List; import java.util.List;
import java.util.Map;
public interface CurriculaVariableMapper extends BaseMapper<CurriculaVariable> public interface CurriculaVariableMapper extends BaseMapper<CurriculaVariable>
{ {
...@@ -21,4 +22,11 @@ public interface CurriculaVariableMapper extends BaseMapper<CurriculaVariable> ...@@ -21,4 +22,11 @@ public interface CurriculaVariableMapper extends BaseMapper<CurriculaVariable>
* @return * @return
*/ */
List<Long> selectByGrade(@Param("grade") String grade); List<Long> selectByGrade(@Param("grade") String grade);
/**
* 获取班级下拉框
* @param grade
* @return
*/
List<Map<String,String>> selectClass(@Param("grade") String grade);
} }
package yangtz.cs.liu.campus.mapper.curricula; package yangtz.cs.liu.campus.mapper.curricula;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.student.SchoolStudentScore; import yangtz.cs.liu.campus.domain.student.SchoolStudentScore;
import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo; import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
...@@ -14,4 +15,25 @@ public interface StudentScoreMapper extends BaseMapper<SchoolStudentScore> { ...@@ -14,4 +15,25 @@ public interface StudentScoreMapper extends BaseMapper<SchoolStudentScore> {
* @return * @return
*/ */
List<SchoolStudentScoreVo> selectStudentScoreList(SchoolStudentScoreVo schoolStudentScoreVo); List<SchoolStudentScoreVo> selectStudentScoreList(SchoolStudentScoreVo schoolStudentScoreVo);
/**
* 根据身份证号获取学生信息
* @param idCard
* @return
*/
SchoolStudentScoreVo selectStudent(@Param("idCard") String idCard);
/**
* 查询学生成绩详细信息
* @param id
* @return
*/
SchoolStudentScoreVo selectStudentScoreById(Long id);
/**
* 批量删除学生成绩信息
* @param ids
* @return
*/
int deleteStudentScore(Long[] ids);
} }
package yangtz.cs.liu.campus.service.curricula; package yangtz.cs.liu.campus.service.curricula;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent; import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo; import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo;
...@@ -17,9 +16,24 @@ public interface ICurriculaStudentService extends IService<CurriculaStudent> { ...@@ -17,9 +16,24 @@ public interface ICurriculaStudentService extends IService<CurriculaStudent> {
List<CurriculaStudentVo> selectCurriculaStudentList(CurriculaStudentVo curriculaStudentVo); List<CurriculaStudentVo> selectCurriculaStudentList(CurriculaStudentVo curriculaStudentVo);
/** /**
* 查询专业字典 * 查看春季选课情况列表
* @param dictValue * @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentListCj(CurriculaStudentVo curriculaStudentVo);
/**
* 查看夏季选课情况列表
* @param curriculaStudentVo
* @return * @return
*/ */
String selectZyZd(String dictValue); List<CurriculaStudentVo> selectCurriculaStudentListXj(CurriculaStudentVo curriculaStudentVo);
/**
* 查看艺体选课情况列表
* @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentListYt(CurriculaStudentVo curriculaStudentVo);
} }
package yangtz.cs.liu.campus.service.curricula; package yangtz.cs.liu.campus.service.curricula;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.curricula.CurriculaVariable; import yangtz.cs.liu.campus.domain.curricula.CurriculaVariable;
import yangtz.cs.liu.campus.vo.curricula.CurriculaVariableVo; import yangtz.cs.liu.campus.vo.curricula.CurriculaVariableVo;
...@@ -35,4 +36,17 @@ public interface ICurriculaVariableService extends IService<CurriculaVariable> { ...@@ -35,4 +36,17 @@ public interface ICurriculaVariableService extends IService<CurriculaVariable> {
*/ */
Map<String,String> getNewGrade(); Map<String,String> getNewGrade();
/**
* 获取班级下拉框
* @param grade
* @return
*/
List<Map<String,String>> selectClass(String grade);
/**
* 修改选课任务
* @param curriculaVariable
* @return
*/
int updateCurriculaVariable(CurriculaVariable curriculaVariable);
} }
...@@ -16,15 +16,50 @@ public interface IStudentScoreService extends IService<SchoolStudentScore> { ...@@ -16,15 +16,50 @@ public interface IStudentScoreService extends IService<SchoolStudentScore> {
List<SchoolStudentScoreVo> selectStudentScoreList(SchoolStudentScoreVo schoolStudentScoreVo); List<SchoolStudentScoreVo> selectStudentScoreList(SchoolStudentScoreVo schoolStudentScoreVo);
/** /**
* 查询学生成绩详细信息
* @param id
* @return
*/
SchoolStudentScoreVo selectStudentScoreById(Long id);
/**
* 导入 * 导入
* @param list * @param list
* @return * @return
*/ */
String importExamDetail(List<SchoolStudentScoreVo> list); String importExamDetail(List<SchoolStudentScoreVo> list,Long curriculaId);
/** /**
* 校验 * 校验
* @param list * @param list
*/ */
void checkImport(List<SchoolStudentScoreVo> list); void checkImport(List<SchoolStudentScoreVo> list);
/**
* 根据身份证号获取学生信息
* @param idCard
* @return
*/
SchoolStudentScoreVo selectStudent(String idCard);
/**
* 新增学生成绩
* @param schoolStudentScore
* @return
*/
int insertStudentScore(SchoolStudentScore schoolStudentScore);
/**
* 修改学生成绩信息
* @param schoolStudentScore
* @return
*/
int updateStudentScore(SchoolStudentScore schoolStudentScore);
/**
* 批量删除学生成绩信息
* @param ids
* @return
*/
int deleteStudentScore(Long[] ids);
} }
package yangtz.cs.liu.campus.service.impl.curricula; package yangtz.cs.liu.campus.service.impl.curricula;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.StringUtils;
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 yangtz.cs.liu.campus.domain.curricula.CurriculaStudent; import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent;
import yangtz.cs.liu.campus.domain.student.SchoolStudentScore;
import yangtz.cs.liu.campus.mapper.curricula.CurriculaStudentMapper; import yangtz.cs.liu.campus.mapper.curricula.CurriculaStudentMapper;
import yangtz.cs.liu.campus.mapper.curricula.StudentScoreMapper;
import yangtz.cs.liu.campus.service.curricula.ICurriculaStudentService; import yangtz.cs.liu.campus.service.curricula.ICurriculaStudentService;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo; import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo;
...@@ -15,6 +19,8 @@ public class CurriculaStudentServiceImpl extends ServiceImpl<CurriculaStudentMap ...@@ -15,6 +19,8 @@ public class CurriculaStudentServiceImpl extends ServiceImpl<CurriculaStudentMap
@Autowired @Autowired
private CurriculaStudentMapper curriculaStudentMapper; private CurriculaStudentMapper curriculaStudentMapper;
@Autowired
private StudentScoreMapper studentScoreMapper;
/** /**
* 查看选课情况列表 * 查看选课情况列表
...@@ -27,12 +33,144 @@ public class CurriculaStudentServiceImpl extends ServiceImpl<CurriculaStudentMap ...@@ -27,12 +33,144 @@ public class CurriculaStudentServiceImpl extends ServiceImpl<CurriculaStudentMap
} }
/** /**
* 查询专业字典 * 查看春季选课情况列表
* @param dictValue * @param curriculaStudentVo
* @return
*/
@Override
public List<CurriculaStudentVo> selectCurriculaStudentListCj(CurriculaStudentVo curriculaStudentVo) {
return curriculaStudentMapper.selectCurriculaStudentListCj(curriculaStudentVo);
}
/**
* 查看夏季选课情况列表
* @param curriculaStudentVo
* @return
*/
@Override
public List<CurriculaStudentVo> selectCurriculaStudentListXj(CurriculaStudentVo curriculaStudentVo) {
List<CurriculaStudentVo> curriculaStudentVoList = curriculaStudentMapper.selectCurriculaStudentListXj(curriculaStudentVo);
curriculaStudentVoList.forEach(curriculaStudentVo1 -> {
//查询学生成绩
LambdaQueryWrapper<SchoolStudentScore> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolStudentScore::getStudentId,curriculaStudentVo1.getStudentId())
.like(SchoolStudentScore::getExamType,"1,2,3")
.orderByDesc(SchoolStudentScore::getExamType).last("LIMIT 1");
SchoolStudentScore schoolStudentScore = studentScoreMapper.selectOne(wrapper);
if (StringUtils.isNotNull(schoolStudentScore)){
//物理+政治+化学
if (curriculaStudentVo1.getSelectedCourse().equals("1")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getPolitics() + schoolStudentScore.getChemistry();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+政治+生物
if (curriculaStudentVo1.getSelectedCourse().equals("2")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getPolitics() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+政治+地理
if (curriculaStudentVo1.getSelectedCourse().equals("3")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getPolitics() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+政治+历史
if (curriculaStudentVo1.getSelectedCourse().equals("4")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getPolitics() + schoolStudentScore.getHistory();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+历史+化学
if (curriculaStudentVo1.getSelectedCourse().equals("5")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getHistory() + schoolStudentScore.getChemistry();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+历史+生物
if (curriculaStudentVo1.getSelectedCourse().equals("6")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getHistory() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+地理+化学
if (curriculaStudentVo1.getSelectedCourse().equals("7")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getGeography() + schoolStudentScore.getChemistry();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+地理+生物
if (curriculaStudentVo1.getSelectedCourse().equals("8")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getGeography() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+化学+生物
if (curriculaStudentVo1.getSelectedCourse().equals("9")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getChemistry() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+历史+地理
if (curriculaStudentVo1.getSelectedCourse().equals("10")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getHistory() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
//化学+政治+地理
if (curriculaStudentVo1.getSelectedCourse().equals("11")){
double courseScore = schoolStudentScore.getChemistry() + schoolStudentScore.getPolitics() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
//化学+政治+历史
if (curriculaStudentVo1.getSelectedCourse().equals("12")){
double courseScore = schoolStudentScore.getChemistry() + schoolStudentScore.getPolitics() + schoolStudentScore.getHistory();
curriculaStudentVo1.setCourseScore(courseScore);
}
//化学+政治+生物
if (curriculaStudentVo1.getSelectedCourse().equals("13")){
double courseScore = schoolStudentScore.getChemistry() + schoolStudentScore.getPolitics() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//化学+历史+地理
if (curriculaStudentVo1.getSelectedCourse().equals("14")){
double courseScore = schoolStudentScore.getChemistry() + schoolStudentScore.getHistory() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
//化学+历史+生物
if (curriculaStudentVo1.getSelectedCourse().equals("15")){
double courseScore = schoolStudentScore.getChemistry() + schoolStudentScore.getHistory() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//化学+地理+生物
if (curriculaStudentVo1.getSelectedCourse().equals("16")){
double courseScore = schoolStudentScore.getChemistry() + schoolStudentScore.getGeography() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//生物+政治+地理
if (curriculaStudentVo1.getSelectedCourse().equals("17")){
double courseScore = schoolStudentScore.getBiology() + schoolStudentScore.getPolitics() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
//生物+历史+地理
if (curriculaStudentVo1.getSelectedCourse().equals("18")){
double courseScore = schoolStudentScore.getBiology() + schoolStudentScore.getHistory() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
//生物+政治+历史
if (curriculaStudentVo1.getSelectedCourse().equals("19")){
double courseScore = schoolStudentScore.getBiology() + schoolStudentScore.getPolitics() + schoolStudentScore.getHistory();
curriculaStudentVo1.setCourseScore(courseScore);
}
//政治+历史+地理
if (curriculaStudentVo1.getSelectedCourse().equals("20")){
double courseScore = schoolStudentScore.getPolitics() + schoolStudentScore.getHistory() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
}
});
return curriculaStudentVoList;
}
/**
* 查看艺体选课情况列表
* @param curriculaStudentVo
* @return * @return
*/ */
@Override @Override
public String selectZyZd(String dictValue) { public List<CurriculaStudentVo> selectCurriculaStudentListYt(CurriculaStudentVo curriculaStudentVo) {
return curriculaStudentMapper.selectZyZd(dictValue); List<CurriculaStudentVo> curriculaStudentVoList = curriculaStudentMapper.selectCurriculaStudentListYt(curriculaStudentVo);
return curriculaStudentVoList;
} }
} }
...@@ -133,4 +133,32 @@ public class CurriculaVariableServiceImpl extends ServiceImpl<CurriculaVariableM ...@@ -133,4 +133,32 @@ public class CurriculaVariableServiceImpl extends ServiceImpl<CurriculaVariableM
map.put("grade",schoolGrade.getGradeYear()); map.put("grade",schoolGrade.getGradeYear());
return map; return map;
} }
/**
* 获取班级下拉框
* @param grade
* @return
*/
@Override
public List<Map<String, String>> selectClass(String grade) {
return curriculaVariableMapper.selectClass(grade);
}
/**
* 修改选课任务
* @param curriculaVariable
* @return
*/
@Override
public int updateCurriculaVariable(CurriculaVariable curriculaVariable) {
LambdaQueryWrapper<CurriculaVariable> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CurriculaVariable::getGrade,curriculaVariable.getGrade())
.ne(CurriculaVariable::getId,curriculaVariable.getId())
.eq(CurriculaVariable::getDelFlag,'0');
List<CurriculaVariable> curriculaVariables = curriculaVariableMapper.selectList(wrapper);
if (curriculaVariables.size() > 0){
throw new ServiceException("已存在当前级部");
}
return curriculaVariableMapper.updateById(curriculaVariable);
}
} }
...@@ -23,6 +23,7 @@ import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo; ...@@ -23,6 +23,7 @@ import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -323,13 +324,23 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch ...@@ -323,13 +324,23 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch
} }
/** /**
* 查看学生成绩详细信息
* @param id
* @return
*/
@Override
public SchoolStudentScoreVo selectStudentScoreById(Long id) {
return studentScoreMapper.selectStudentScoreById(id);
}
/**
* 导入 * 导入
* @param list * @param list
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String importExamDetail(List<SchoolStudentScoreVo> list) { public String importExamDetail(List<SchoolStudentScoreVo> list,Long curriculaId) {
// 准备记录日志数据 // 准备记录日志数据
int successNum = 0; int successNum = 0;
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
...@@ -341,18 +352,40 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch ...@@ -341,18 +352,40 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch
//赋值 //赋值
SchoolStudentScore schoolStudentScore = new SchoolStudentScore(); SchoolStudentScore schoolStudentScore = new SchoolStudentScore();
schoolStudentScore.setStudentId(schoolStudent.getId()); schoolStudentScore.setStudentId(schoolStudent.getId());
schoolStudentScore.setCurriculaId(curriculaId);
schoolStudentScore.setClassId(schoolStudent.getClassId());
schoolStudentScore.setExamType(schoolStudentScoreVo.getExamType()); schoolStudentScore.setExamType(schoolStudentScoreVo.getExamType());
// schoolStudentScore.setLanguage(schoolStudentScoreVo.getLanguage()); schoolStudentScore.setLanguage(schoolStudentScoreVo.getLanguage());
// schoolStudentScore.setMath(schoolStudentScoreVo.getMath()); schoolStudentScore.setMath(schoolStudentScoreVo.getMath());
// schoolStudentScore.setEnglish(schoolStudentScoreVo.getEnglish()); schoolStudentScore.setEnglish(schoolStudentScoreVo.getEnglish());
// schoolStudentScore.setPolitics(schoolStudentScoreVo.getPolitics()); schoolStudentScore.setPolitics(schoolStudentScoreVo.getPolitics());
// schoolStudentScore.setGeography(schoolStudentScoreVo.getGeography()); schoolStudentScore.setGeography(schoolStudentScoreVo.getGeography());
// schoolStudentScore.setHistory(schoolStudentScoreVo.getHistory()); schoolStudentScore.setHistory(schoolStudentScoreVo.getHistory());
// schoolStudentScore.setPhysics(schoolStudentScoreVo.getPhysics()); schoolStudentScore.setPhysics(schoolStudentScoreVo.getPhysics());
// schoolStudentScore.setChemistry(schoolStudentScoreVo.getChemistry()); schoolStudentScore.setChemistry(schoolStudentScoreVo.getChemistry());
// schoolStudentScore.setBiology(schoolStudentScoreVo.getBiology()); schoolStudentScore.setBiology(schoolStudentScoreVo.getBiology());
schoolStudentScore.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName()); schoolStudentScore.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolStudentScore.setCreateTime(DateUtils.getNowDate()); schoolStudentScore.setCreateTime(DateUtils.getNowDate());
LambdaQueryWrapper<SchoolStudentScore> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(SchoolStudentScore::getExamType,schoolStudentScore.getExamType())
.eq(SchoolStudentScore::getStudentId,schoolStudentScore.getStudentId())
.eq(SchoolStudentScore::getDelFlag,"0");
List<SchoolStudentScore> schoolStudentScores = studentScoreMapper.selectList(wrapper1);
String examType = schoolStudentScoreVo.getExamType();
switch (examType){
case "1":
examType = "一次";
break;
case "2":
examType = "二次";
break;
case "3":
examType = "三次";
break;
}
if (schoolStudentScores.size() > 0){
throw new ServiceException("已存在" + schoolStudentScoreVo.getStudentName() + "学生" + examType + "考试成绩");
}
studentScoreMapper.insert(schoolStudentScore); studentScoreMapper.insert(schoolStudentScore);
successNum ++; successNum ++;
} }
...@@ -416,4 +449,64 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch ...@@ -416,4 +449,64 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch
throw new BaseException(failureMsg.toString()); throw new BaseException(failureMsg.toString());
} }
} }
/**
* 根据身份证号获取学生信息
* @param idCard
* @return
*/
@Override
public SchoolStudentScoreVo selectStudent(String idCard) {
SchoolStudentScoreVo schoolStudentScoreVo = studentScoreMapper.selectStudent(idCard);
if (StringUtils.isNull(schoolStudentScoreVo)){
throw new ServiceException("未查询到该学生信息,请仔细核对身份证号码");
}
return schoolStudentScoreVo;
}
/**
* 新增学生成绩信息
* @param schoolStudentScore
* @return
*/
@Override
@Transactional
public int insertStudentScore(SchoolStudentScore schoolStudentScore) {
//判断是否存在该学生此次考试成绩
LambdaQueryWrapper<SchoolStudentScore> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolStudentScore::getExamType,schoolStudentScore.getExamType())
.eq(SchoolStudentScore::getStudentId,schoolStudentScore.getStudentId())
.eq(SchoolStudentScore::getDelFlag,"0");
List<SchoolStudentScore> schoolStudentScores = studentScoreMapper.selectList(wrapper);
if (schoolStudentScores.size() > 0){
throw new ServiceException("已存在该学生此次考试成绩");
}
schoolStudentScore.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolStudentScore.setCreateTime(DateUtils.getNowDate());
return studentScoreMapper.insert(schoolStudentScore);
}
/**
* 修改学生成绩信息
* @param schoolStudentScore
* @return
*/
@Override
public int updateStudentScore(SchoolStudentScore schoolStudentScore) {
schoolStudentScore.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolStudentScore.setUpdateTime(DateUtils.getNowDate());
return studentScoreMapper.updateById(schoolStudentScore);
}
/**
* 批量删除学生成绩信息
* @param ids
* @return
*/
@Override
public int deleteStudentScore(Long[] ids) {
return studentScoreMapper.deleteStudentScore(ids);
}
} }
package yangtz.cs.liu.campus.vo.curricula;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
@Data
public class CurriculaStudentCjVo {
/** 主键id */
private Long id;
/** 学生主键id */
private Long studentId;
/** 选课主键id */
private Long curriculaId;
/** 班级主键id */
private Long classId;
/** 班级 */
@Excel(name = "班级")
private String className;
/** 学生姓名 */
@Excel(name = "学生姓名")
private String studentName;
/** 学号 */
@Excel(name = "学号")
private String studentNumber;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCard;
/** 成绩 */
private double achievement;
/** 课程类型(1-春季选课,2-夏季选课,3-艺体) */
@Excel(name = "课程类型",readConverterExp = "1=春季选课,2=夏季选课,3=艺体")
private String courseType;
/** 选课时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "选课时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date curriculaTime;
/** 选课状态(1-未选课,2-已选课) */
// @Excel(name = "选课状态",readConverterExp = "1=未选课,2=已选课")
private String curriculaState;
/** 已选课程成绩 */
private double courseScore;
/** 已选课程 */
// @Excel(name = "已选课程",readConverterExp = "1=物理+政治+化学,2=物理+政治+生物,3=物理+政治+地理,4=物理+政治+历史,5=物理+历史+化学,6=物理+历史+生物,7=物理+地理+化学,8=物理+地理+生物" +
// ",9=物理+化学+生物,10=物理+历史+地理,11=化学+政治+地理,12=化学+政治+历史,13=化学+政治+生物,14=化学+历史+地理,15=化学+历史+生物,16=化学+地理+生物,17=生物+政治+地理" +
// ",18=生物+历史+地理,19=生物+政治+历史,20=政治+历史+地理")
private String selectedCourse;
/** 已选专业 */
private String selectedMajor;
/** 已选专业名称 */
@Excel(name = "已选专业")
private String selectedMajorName;
/** 所选科目 */
// @Excel(name = "所选科目",readConverterExp = "1=音乐,2=美术,3=田径,4=舞蹈")
private String selectedSubject;
/** 所分班级 */
// @Excel(name = "所分班级")
private String divisionClassesName;
/** 是否删除 */
private String delFalg;
}
...@@ -16,6 +16,8 @@ public class CurriculaStudentVo { ...@@ -16,6 +16,8 @@ public class CurriculaStudentVo {
private Long studentId; private Long studentId;
/** 选课主键id */ /** 选课主键id */
private Long curriculaId; private Long curriculaId;
/** 班级主键id */
private Long classId;
/** 班级 */ /** 班级 */
@Excel(name = "班级") @Excel(name = "班级")
private String className; private String className;
...@@ -28,6 +30,9 @@ public class CurriculaStudentVo { ...@@ -28,6 +30,9 @@ public class CurriculaStudentVo {
/** 学号 */ /** 学号 */
@Excel(name = "学号") @Excel(name = "学号")
private String studentNumber; private String studentNumber;
/** 成绩 */
@Excel(name = "成绩")
private double achievement;
/** 课程类型(1-春季选课,2-夏季选课,3-艺体) */ /** 课程类型(1-春季选课,2-夏季选课,3-艺体) */
@Excel(name = "课程类型",readConverterExp = "1=春季选课,2=夏季选课,3=艺体") @Excel(name = "课程类型",readConverterExp = "1=春季选课,2=夏季选课,3=艺体")
private String courseType; private String courseType;
...@@ -38,11 +43,13 @@ public class CurriculaStudentVo { ...@@ -38,11 +43,13 @@ public class CurriculaStudentVo {
/** 选课状态(1-未选课,2-已选课) */ /** 选课状态(1-未选课,2-已选课) */
@Excel(name = "选课状态",readConverterExp = "1=未选课,2=已选课") @Excel(name = "选课状态",readConverterExp = "1=未选课,2=已选课")
private String curriculaState; private String curriculaState;
/** 已选课程成绩 */
private double courseScore;
/** 已选课程 */ /** 已选课程 */
@Excel(name = "已选课程",readConverterExp = "1=物理+政治+化学,2=物理+政治+生物,3=物理+政治+地理,4=物理+政治+历史,5=物理+历史+化学,6=物理+历史+生物,7=物理+地理+化学,8=物理+地理+生物" + @Excel(name = "已选课程",readConverterExp = "1=物理+政治+化学,2=物理+政治+生物,3=物理+政治+地理,4=物理+政治+历史,5=物理+历史+化学,6=物理+历史+生物,7=物理+地理+化学,8=物理+地理+生物" +
",9=物理+化学+生物,10=物理+历史+地理,11=化学+政治+地理,12=化学+政治+历史,13=化学+政治+生物,14=化学+历史+地理,15=化学+历史+生物,16=化学+地理+生物,17=生物+政治+地理" + ",9=物理+化学+生物,10=物理+历史+地理,11=化学+政治+地理,12=化学+政治+历史,13=化学+政治+生物,14=化学+历史+地理,15=化学+历史+生物,16=化学+地理+生物,17=生物+政治+地理" +
",18=生物+历史+地理,19=生物+政治+历史,20=政治+历史+地理") ",18=生物+历史+地理,19=生物+政治+历史,20=政治+历史+地理")
private Integer selectedCourse; private String selectedCourse;
/** 已选专业 */ /** 已选专业 */
private String selectedMajor; private String selectedMajor;
/** 已选专业名称 */ /** 已选专业名称 */
...@@ -50,10 +57,10 @@ public class CurriculaStudentVo { ...@@ -50,10 +57,10 @@ public class CurriculaStudentVo {
private String selectedMajorName; private String selectedMajorName;
/** 所选科目 */ /** 所选科目 */
@Excel(name = "所选科目",readConverterExp = "1=音乐,2=美术,3=田径,4=舞蹈") @Excel(name = "所选科目",readConverterExp = "1=音乐,2=美术,3=田径,4=舞蹈")
private Integer selectedSubject; private String selectedSubject;
/** 所分班级 */ /** 所分班级 */
@Excel(name = "所分班级") @Excel(name = "所分班级")
private String divisionClasses; private String divisionClassesName;
/** 是否删除 */ /** 是否删除 */
private String delFalg; private String delFalg;
} }
package yangtz.cs.liu.campus.vo.curricula;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
@Data
public class CurriculaStudentXjVo {
/** 主键id */
private Long id;
/** 学生主键id */
private Long studentId;
/** 选课主键id */
private Long curriculaId;
/** 班级主键id */
private Long classId;
/** 班级 */
@Excel(name = "班级")
private String className;
/** 学生姓名 */
@Excel(name = "学生姓名")
private String studentName;
/** 学号 */
@Excel(name = "学号")
private String studentNumber;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCard;
/** 成绩 */
private double achievement;
/** 课程类型(1-春季选课,2-夏季选课,3-艺体) */
// @Excel(name = "课程类型",readConverterExp = "1=春季选课,2=夏季选课,3=艺体")
private String courseType;
/** 选课时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
// @Excel(name = "选课时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date curriculaTime;
/** 选课状态(1-未选课,2-已选课) */
// @Excel(name = "选课状态",readConverterExp = "1=未选课,2=已选课")
private String curriculaState;
/** 已选课程成绩 */
@Excel(name = "成绩")
private double courseScore;
/** 已选课程 */
@Excel(name = "已选课程",readConverterExp = "1=物理+政治+化学,2=物理+政治+生物,3=物理+政治+地理,4=物理+政治+历史,5=物理+历史+化学,6=物理+历史+生物,7=物理+地理+化学,8=物理+地理+生物" +
",9=物理+化学+生物,10=物理+历史+地理,11=化学+政治+地理,12=化学+政治+历史,13=化学+政治+生物,14=化学+历史+地理,15=化学+历史+生物,16=化学+地理+生物,17=生物+政治+地理" +
",18=生物+历史+地理,19=生物+政治+历史,20=政治+历史+地理")
private String selectedCourse;
/** 已选专业 */
private String selectedMajor;
/** 已选专业名称 */
// @Excel(name = "已选专业")
private String selectedMajorName;
/** 所选科目 */
// @Excel(name = "所选科目",readConverterExp = "1=音乐,2=美术,3=田径,4=舞蹈")
private String selectedSubject;
/** 所分班级 */
@Excel(name = "所分班级")
private String divisionClassesName;
/** 是否删除 */
private String delFalg;
}
package yangtz.cs.liu.campus.vo.curricula;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
@Data
public class CurriculaStudentYtVo {
/** 主键id */
private Long id;
/** 学生主键id */
private Long studentId;
/** 选课主键id */
private Long curriculaId;
/** 班级主键id */
private Long classId;
/** 班级 */
@Excel(name = "班级")
private String className;
/** 学生姓名 */
@Excel(name = "学生姓名")
private String studentName;
/** 学号 */
@Excel(name = "学号")
private String studentNumber;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCard;
/** 成绩 */
private double achievement;
/** 课程类型(1-春季选课,2-夏季选课,3-艺体) */
@Excel(name = "课程类型",readConverterExp = "1=春季选课,2=夏季选课,3=艺体")
private String courseType;
/** 选课时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "选课时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date curriculaTime;
/** 选课状态(1-未选课,2-已选课) */
// @Excel(name = "选课状态",readConverterExp = "1=未选课,2=已选课")
private String curriculaState;
/** 已选课程成绩 */
// @Excel(name = "成绩")
private double courseScore;
/** 已选专业 */
private String selectedMajor;
/** 已选专业名称 */
// @Excel(name = "已选专业")
private String selectedMajorName;
/** 所选科目 */
@Excel(name = "所选科目",readConverterExp = "1=音乐,2=美术,3=田径,4=舞蹈")
private String selectedSubject;
/** 已选课程 */
@Excel(name = "已选课程",readConverterExp = "1=物理+政治+化学,2=物理+政治+生物,3=物理+政治+地理,4=物理+政治+历史,5=物理+历史+化学,6=物理+历史+生物,7=物理+地理+化学,8=物理+地理+生物" +
",9=物理+化学+生物,10=物理+历史+地理,11=化学+政治+地理,12=化学+政治+历史,13=化学+政治+生物,14=化学+历史+地理,15=化学+历史+生物,16=化学+地理+生物,17=生物+政治+地理" +
",18=生物+历史+地理,19=生物+政治+历史,20=政治+历史+地理")
private String selectedCourse;
/** 所分班级 */
// @Excel(name = "所分班级")
private String divisionClassesName;
/** 是否删除 */
private String delFalg;
}
...@@ -17,14 +17,15 @@ ...@@ -17,14 +17,15 @@
<result property="selectedCourse" column="selected_course" /> <result property="selectedCourse" column="selected_course" />
<result property="selectedMajor" column="selected_major" /> <result property="selectedMajor" column="selected_major" />
<result property="selectedSubject" column="selected_subject" /> <result property="selectedSubject" column="selected_subject" />
<result property="divisionClasses" column="division_classes" /> <result property="divisionClassesName" column="division_classes_name" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
</resultMap> </resultMap>
<select id="countNum" parameterType="Long" resultType="Map"> <select id="countNum" parameterType="Long" resultType="Map">
SELECT COUNT(id) as zrs,(SELECT COUNT(id) FROM curricula_student WHERE curricula_state = '2' AND del_flag = '0') as yxrs FROM curricula_student WHERE curricula_id = #{curriculaId} AND del_flag = '0' SELECT COUNT(id) as zrs,(SELECT COUNT(id) FROM curricula_student WHERE curricula_id = #{curriculaId} and curricula_state = '2' AND del_flag = '0') as yxrs FROM curricula_student WHERE curricula_id = #{curriculaId} AND del_flag = '0'
</select> </select>
<!--选课情况列表-->
<select id="selectCurriculaStudentList" parameterType="CurriculaStudentVo" resultMap="CurriculaStudentVoResult"> <select id="selectCurriculaStudentList" parameterType="CurriculaStudentVo" resultMap="CurriculaStudentVoResult">
SELECT SELECT
xk.id, xk.id,
...@@ -54,8 +55,97 @@ ...@@ -54,8 +55,97 @@
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if> <if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
</select> </select>
<select id="selectZyZd" parameterType="String" resultType="String"> <!--春季选课情况列表-->
SELECT dict_label FROM `sys_dict_data` WHERE dict_value=#{dictValue} AND dict_type = "specialty" <select id="selectCurriculaStudentListCj" parameterType="CurriculaStudentVo" resultMap="CurriculaStudentVoResult">
SELECT
xk.id,
xk.student_id,
xk.curricula_id,
bj.class_name,
xs.student_name,
xs.id_card,
xs.school_no AS student_number,
xk.course_type,
xk.curricula_time,
xk.curricula_state,
xk.selected_course,
xk.selected_major,
xk.selected_subject,
dc.division_classes_name
FROM
curricula_student xk
LEFT JOIN school_student xs ON xk.student_id = xs.id
LEFT JOIN school_class bj ON xs.class_id = bj.id
LEFT JOIN school_division_student ds ON xk.student_id = ds.student_id
LEFT JOIN school_division_classes dc ON ds.division_classes_id = dc.id
WHERE
xk.curricula_id = #{curriculaId} and xk.course_type = '1' and xk.del_flag = '0'
<if test="classId != null">and xs.class_id = #{classId}</if>
<if test="selectedMajor != null and selectedMajor != ''">and xk.selected_major like concat('%', #{selectedMajor}, '%')</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
</select>
<!--夏季选课情况列表-->
<select id="selectCurriculaStudentListXj" parameterType="CurriculaStudentVo" resultMap="CurriculaStudentVoResult">
SELECT
xk.id,
xk.student_id,
xk.curricula_id,
bj.class_name,
xs.student_name,
xs.id_card,
xs.school_no AS student_number,
xk.course_type,
xk.curricula_time,
xk.curricula_state,
xk.selected_course,
xk.selected_major,
xk.selected_subject,
dc.division_classes_name
FROM
curricula_student xk
LEFT JOIN school_student xs ON xk.student_id = xs.id
LEFT JOIN school_class bj ON xs.class_id = bj.id
LEFT JOIN school_division_student ds ON xk.student_id = ds.student_id
LEFT JOIN school_division_classes dc ON ds.division_classes_id = dc.id
WHERE
xk.curricula_id = #{curriculaId} and xk.course_type = '2' and xk.del_flag = '0'
<if test="classId != null">and xs.class_id = #{classId}</if>
<if test="selectedCourse != null and selectedCourse != ''">and xk.selected_course = #{selectedCourse}</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
ORDER BY xk.selected_course ASC
</select>
<!--艺体选课情况列表-->
<select id="selectCurriculaStudentListYt" parameterType="CurriculaStudentVo" resultMap="CurriculaStudentVoResult">
SELECT
xk.id,
xk.student_id,
xk.curricula_id,
bj.class_name,
xs.student_name,
xs.id_card,
xs.school_no AS student_number,
xk.course_type,
xk.curricula_time,
xk.curricula_state,
xk.selected_course,
xk.selected_major,
xk.selected_subject,
dc.division_classes_name
FROM
curricula_student xk
LEFT JOIN school_student xs ON xk.student_id = xs.id
LEFT JOIN school_class bj ON xs.class_id = bj.id
LEFT JOIN school_division_student ds ON xk.student_id = ds.student_id
LEFT JOIN school_division_classes dc ON ds.division_classes_id = dc.id
WHERE
xk.curricula_id = #{curriculaId} and xk.course_type = '3' and xk.del_flag = '0'
<if test="classId != null">and xs.class_id = #{classId}</if>
<if test="selectedSubject != null and selectedSubject != ''">and xk.selected_subject = #{selectedSubject}</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
ORDER BY xk.selected_subject ASC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -59,4 +59,8 @@ ...@@ -59,4 +59,8 @@
g.grade_year = #{grade} g.grade_year = #{grade}
AND g.del_flag = '0') AND g.del_flag = '0')
</select> </select>
<select id="selectClass" parameterType="String" resultType="Map">
SELECT id as classId,class_name as className FROM school_class WHERE grade_id = (SELECT id FROM school_grade where grade_year = #{grade} AND del_flag = '0')
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -64,10 +64,58 @@ ...@@ -64,10 +64,58 @@
<if test="examType != null and examType != ''">and cj.exam_type = #{examType}</if> <if test="examType != null and examType != ''">and cj.exam_type = #{examType}</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if> <if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
<if test="classId != null">and cj.class_id = #{classId}</if> <if test="classId != null">and cj.class_id = #{classId}</if>
<if test="className != null and className != ''">and xs.class_name like concat('%', #{className}, '%')</if> <if test="className != null and className != ''">and bj.class_name like concat('%', #{className}, '%')</if>
ORDER BY ORDER BY
student_id, student_id,
exam_type ASC exam_type ASC
</select> </select>
<select id="selectStudent" parameterType="String" resultMap="SchoolStudentScoreVoResult">
SELECT xs.class_id,bj.class_name,xs.id as student_id,xs.student_name,xs.id_card,xs.school_no as student_number
FROM curricula_student cs
LEFT JOIN school_student xs ON cs.student_id = xs.id
LEFT JOIN school_class bj ON xs.class_id = bj.id
WHERE xs.id_card = #{idCard} AND xs.del_flag = '0'
</select>
<select id="selectStudentScoreById" parameterType="Long" resultMap="SchoolStudentScoreVoResult">
SELECT
cj.id,
cj.student_id,
cj.curricula_id,
xs.student_name,
xs.id_card,
xs.school_no as student_number,
cj.class_id,
bj.class_name,
cj.exam_type,
(cj.`language` + cj.math + cj.english + cj.politics + cj.geography + cj.history + cj.physics + cj.chemistry + cj.biology) as total_score,
cj.`language`,
cj.math,
cj.english,
cj.politics,
cj.geography,
cj.history,
cj.physics,
cj.chemistry,
cj.biology,
cj.create_by,
cj.create_time,
cj.update_by,
cj.update_time
FROM
school_student_score cj
LEFT JOIN school_student xs ON cj.student_id = xs.id
LEFT JOIN school_class bj ON cj.class_id = bj.id
WHERE
cj.id = #{id}
</select>
<update id="deleteStudentScore" parameterType="String">
update school_student_score set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper> </mapper>
\ No newline at end of file
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