From 184b0fe675ffcb6b9effbea81e3b38d080b1fe1a Mon Sep 17 00:00:00 2001 From: mumu Date: Sun, 23 Aug 2020 23:56:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=94=E8=AF=95=E5=90=8D=E5=8D=95=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/jxjs/TsbzJdcxController.java | 35 +++++- .../java/com/ruoyi/jxjs/domain/TsbzJdcx.java | 108 +++++++++-------- .../com/ruoyi/jxjs/mapper/TsbzJdcxMapper.java | 7 ++ .../ruoyi/jxjs/service/ITsbzJdcxService.java | 7 ++ .../service/impl/TsbzJdcxServiceImpl.java | 11 ++ .../resources/mapper/jxjs/TsbzJdcxMapper.xml | 30 ++++- ruoyi-ui/src/api/jxjs/jdcx.js | 9 +- ruoyi-ui/src/views/jxjs/bsmd/index.vue | 114 +++++++++++++----- 8 files changed, 236 insertions(+), 85 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/jxjs/TsbzJdcxController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/jxjs/TsbzJdcxController.java index 2a6a06df0..608236e4b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/jxjs/TsbzJdcxController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/jxjs/TsbzJdcxController.java @@ -4,7 +4,10 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.jxjs.domain.TsbzJxzxmd; import com.ruoyi.jxjs.service.ITsbzJxzxmdService; import com.ruoyi.web.controller.common.SchoolCommonController; @@ -26,6 +29,7 @@ import com.ruoyi.jxjs.domain.TsbzJdcx; import com.ruoyi.jxjs.service.ITsbzJdcxService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; /** * 基地区级审核Controller @@ -50,7 +54,8 @@ public class TsbzJdcxController extends BaseController { @GetMapping("/list") public TableDataInfo list(TsbzJdcx tsbzJdcx) { startPage(); - List list = tsbzJdcxService.selectTsbzJdcxList(tsbzJdcx); +// List list = tsbzJdcxService.selectTsbzJdcxList(tsbzJdcx); + List list = tsbzJdcxService.selectTsbzJdcxExport(tsbzJdcx); return getDataTable(list); } @@ -161,4 +166,32 @@ public class TsbzJdcxController extends BaseController { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(tsbzJdcxService.deleteTsbzJdcxByIds(ids)); } + + @Log(title = "分数导入", businessType = BusinessType.IMPORT) +// @PreAuthorize("@ss.hasPermi('system:user:import')") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file,Long faide) throws Exception + { + ExcelUtil util = new ExcelUtil(TsbzJdcx.class); + List tsbzJdcxList = util.importExcel(file.getInputStream()); + int iCount = 0; + for (TsbzJdcx tsbzJdcx:tsbzJdcxList) { + tsbzJdcx.setFaid(faide); + iCount = iCount + tsbzJdcxService.updateTsbzJdcxforjsfa(tsbzJdcx); + } +// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); +// String operName = loginUser.getUsername(); +// String message = userService.importUser(userList, updateSupport, operName); + //String message = faide; + return AjaxResult.success(String.valueOf(iCount),null); + } + + @GetMapping("/importTemplate") + public AjaxResult importTemplate() + { +// ExcelUtil util = new ExcelUtil(SysUser.class); + ExcelUtil util = new ExcelUtil(TsbzJdcx.class); + return util.importTemplateExcel("成绩导入"); + } + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/jxjs/domain/TsbzJdcx.java b/ruoyi-system/src/main/java/com/ruoyi/jxjs/domain/TsbzJdcx.java index 69337aa3c..c42342a3a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/jxjs/domain/TsbzJdcx.java +++ b/ruoyi-system/src/main/java/com/ruoyi/jxjs/domain/TsbzJdcx.java @@ -3,9 +3,11 @@ package com.ruoyi.jxjs.domain; import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.enums.BusinessType; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.Type; import com.ruoyi.common.core.domain.BaseEntity; /** @@ -21,13 +23,7 @@ public class TsbzJdcx extends BaseEntity /** 编号 */ private Long id; - /** 方案编号 */ -// @Excel(name = "方案编号") - private Long faid; - /** 教师编号 */ -// @Excel(name = "教师编号") - private Long jsid; @@ -51,9 +47,7 @@ public class TsbzJdcx extends BaseEntity // @Excel(name = "区级审核人") private Long qjshr; - /** 区级审核状态 */ -// @Excel(name = "区级审核状态") - private String qjshzt; + /** 区级审核意见 */ // @Excel(name = "区级审核意见") @@ -63,21 +57,7 @@ public class TsbzJdcx extends BaseEntity // @Excel(name = "基地排序") private Long jdpx; - /** 案例分析得分 */ -// @Excel(name = "案例分析得分") - private BigDecimal alfxdf; - /** 教案设计得分 */ -// @Excel(name = "教案设计得分") - private BigDecimal jasjdf; - - /** 钢笔字得分 */ -// @Excel(name = "钢笔字得分") - private BigDecimal gbzdf; - - /** 综合得分 */ -// @Excel(name = "综合得分") - private BigDecimal zhdf; /** 成绩导入创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd") @@ -96,39 +76,63 @@ public class TsbzJdcx extends BaseEntity /** 面试结果模拟课堂教学 */ // @Excel(name = "面试结果模拟课堂教学") private BigDecimal msjgmnktjxdf; - - /** 演讲得分 */ -// @Excel(name = "演讲得分") - private BigDecimal yjdf; - - /** 综合得分2 */ -// @Excel(name = "综合得分2") - private BigDecimal zhdf2; - /** - * 录取状态 - */ + /** 录取状态 */ private String lqzt; - - @Excel(name = "评选名称") - private String faname; - @Excel(name = "基地校") - private String jdxmc; - @Excel(name = "姓名") - private String jsname; - @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知") - private String xb; - @Excel(name = "学段", readConverterExp = "1=学前教育,2=小学,3=普通初中,4=普通高中") - private String rjxd; - @Excel(name = "学科", readConverterExp = "11=品德与生活(社会) ,12=思想品德(政治) ,13=语文 ,14=数学 ,15=科学 ,16=物理 ,17=化学 ,18=生物 ,19=历史与社会 ,20=地理 ,21=历史 ,22=体育与健康 ,23=艺术 ,24=音乐 ,25=美术 ,41=英语") - private String rjxk; - @Excel(name = "联系方式") - private String phone; - @Excel(name = "聘任校") - private String prdwmc; /** 当前状态 */ - @Excel(name = "当前状态") +// @Excel(name = "当前状态") private String dqzt; + + /** 方案编号 */ +// @Excel(name = "方案编号", type = Type.IMPORT) + private Long faid; + + @Excel(name = "方案名称", type = Type.EXPORT) + private String faname; + + /** 教师编号 */ + @Excel(name = "教师编号", type = Type.IMPORT) + private Long jsid; + + @Excel(name = "基地校", type = Type.EXPORT) + private String jdxmc; + @Excel(name = "教师姓名") + private String jsname; + @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知", type = Type.EXPORT) + private String xb; + @Excel(name = "学段", readConverterExp = "1=学前教育,2=小学,3=普通初中,4=普通高中", type = Type.EXPORT) + private String rjxd; + @Excel(name = "学科", readConverterExp = "11=品德与生活(社会) ,12=思想品德(政治) ,13=语文 ,14=数学 ,15=科学 ,16=物理 ,17=化学 ,18=生物 ,19=历史与社会 ,20=地理 ,21=历史 ,22=体育与健康 ,23=艺术 ,24=音乐 ,25=美术 ,41=英语", type = Type.EXPORT) + private String rjxk; + @Excel(name = "联系方式", type = Type.EXPORT) + private String phone; + @Excel(name = "聘任校", type = Type.EXPORT) + private String prdwmc; + /** 区级审核状态 */ + @Excel(name = "评审状态", type = Type.EXPORT) + private String qjshzt; + + /** 案例分析得分 */ + @Excel(name = "案例分析得分", type = Type.IMPORT) + private BigDecimal alfxdf; + /** 教案设计得分 */ + @Excel(name = "教案设计得分", type = Type.IMPORT) + private BigDecimal jasjdf; + /** 钢笔字得分 */ + @Excel(name = "钢笔字得分", type = Type.IMPORT) + private BigDecimal gbzdf; + /** 综合得分 */ + @Excel(name = "综合得分", type = Type.IMPORT) + private BigDecimal zhdf; + /** 演讲得分 */ + @Excel(name = "演讲得分", type = Type.IMPORT) + private BigDecimal yjdf; + /** 综合得分2 */ + @Excel(name = "综合得分2", type = Type.IMPORT) + private BigDecimal zhdf2; + + + public String getFaname() { return faname; } public void setFaname(String faname) { this.faname = faname;} diff --git a/ruoyi-system/src/main/java/com/ruoyi/jxjs/mapper/TsbzJdcxMapper.java b/ruoyi-system/src/main/java/com/ruoyi/jxjs/mapper/TsbzJdcxMapper.java index 17aff3322..c0e636eca 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/jxjs/mapper/TsbzJdcxMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/jxjs/mapper/TsbzJdcxMapper.java @@ -65,4 +65,11 @@ public interface TsbzJdcxMapper * @return 基地区级审核集合 */ public List selectTsbzJdcxExport(TsbzJdcx tsbzJdcx); + /** + * 成绩导入 + * + * @param tsbzJdcx 基地区级审核 + * @return 结果 + */ + public int updateTsbzJdcxforjsfa(TsbzJdcx tsbzJdcx); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/ITsbzJdcxService.java b/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/ITsbzJdcxService.java index b35044e87..8d0ec48d5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/ITsbzJdcxService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/ITsbzJdcxService.java @@ -66,4 +66,11 @@ public interface ITsbzJdcxService * @return 基地区级审核集合 */ public List selectTsbzJdcxExport(TsbzJdcx tsbzJdcx); + /** + * 成绩导入 + * + * @param tsbzJdcx 基地区级审核 + * @return 结果 + */ + public int updateTsbzJdcxforjsfa(TsbzJdcx tsbzJdcx); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/impl/TsbzJdcxServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/impl/TsbzJdcxServiceImpl.java index 10af4dbac..22108d26b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/impl/TsbzJdcxServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/impl/TsbzJdcxServiceImpl.java @@ -104,5 +104,16 @@ public class TsbzJdcxServiceImpl implements ITsbzJdcxService { return tsbzJdcxMapper.selectTsbzJdcxExport(tsbzJdcx); } + /** + * 成绩导入 + * + * @param tsbzJdcx 基地区级审核 + * @return 结果 + */ + @Override + public int updateTsbzJdcxforjsfa(TsbzJdcx tsbzJdcx) + { + return tsbzJdcxMapper.updateTsbzJdcxforjsfa(tsbzJdcx); + } } diff --git a/ruoyi-system/src/main/resources/mapper/jxjs/TsbzJdcxMapper.xml b/ruoyi-system/src/main/resources/mapper/jxjs/TsbzJdcxMapper.xml index 661462969..1b9d125b7 100644 --- a/ruoyi-system/src/main/resources/mapper/jxjs/TsbzJdcxMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/jxjs/TsbzJdcxMapper.xml @@ -189,5 +189,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.zhdf2 = #{zhdf2} - + + update tsbz_jdcx + + faid = #{faid}, + jsid = #{jsid}, + dqzt = #{dqzt}, + createuserid = #{createuserid}, + create_time = #{createTime}, + jdxshr = #{jdxshr}, + jdxshzt = #{jdxshzt}, + sbly = #{sbly}, + qjshr = #{qjshr}, + qjshzt = #{qjshzt}, + qjshyj = #{qjshyj}, + jdpx = #{jdpx}, + alfxdf = #{alfxdf}, + jasjdf = #{jasjdf}, + gbzdf = #{gbzdf}, + zhdf = #{zhdf}, + cjdrcreate_time = #{cjdrcreateTime}, + msqr = #{msqr}, + msqrcreate_time = #{msqrcreateTime}, + msjgmnktjxdf = #{msjgmnktjxdf}, + yjdf = #{yjdf}, + zhdf2 = #{zhdf2}, + lqzt = #{lqzt}, + + where faid = #{faid} and jsid = #{jsid} + \ No newline at end of file diff --git a/ruoyi-ui/src/api/jxjs/jdcx.js b/ruoyi-ui/src/api/jxjs/jdcx.js index cf45bd472..fce66f0ce 100644 --- a/ruoyi-ui/src/api/jxjs/jdcx.js +++ b/ruoyi-ui/src/api/jxjs/jdcx.js @@ -58,4 +58,11 @@ export function checkJdcx(id) { url: '/jxjs/jdcx/check/' + id, method: 'post' }) -} \ No newline at end of file +} +// 下载成绩导入模板 +export function importTemplate() { + return request({ + url: '/jxjs/jdcx/importTemplate', + method: 'get' + }) + } \ No newline at end of file diff --git a/ruoyi-ui/src/views/jxjs/bsmd/index.vue b/ruoyi-ui/src/views/jxjs/bsmd/index.vue index 954600c5e..b96350d7c 100644 --- a/ruoyi-ui/src/views/jxjs/bsmd/index.vue +++ b/ruoyi-ui/src/views/jxjs/bsmd/index.vue @@ -56,14 +56,26 @@ - + + + + + + + + + + + + + - + - + 下载模板 +
将文件拖到此处,或 点击上传
- 是否更新已经存在的用户数据 - 下载模板 + + + + +
+ + +
提示:仅允许导入“xls”或“xlsx”格式文件!
@@ -255,6 +274,7 @@ import { addJdcx, updateJdcx, exportJdcx, + importTemplate, } from "@/api/jxjs/jdcx"; import { getToken } from "@/utils/auth"; @@ -290,6 +310,12 @@ export default { qjshztOptions: [], // 区级审核意见字典 qjshyjOptions: [], + // 性别 + xbOptions: [], + // 学段 + xdOptions: [], + // 学科 + xkOptions: [], //方案 faOptions: [], // 用户导入参数lu @@ -302,10 +328,12 @@ export default { isUploading: false, // 是否更新已经存在的用户数据 updateSupport: 0, + //方案id + faide: "", // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - url: process.env.VUE_APP_BASE_API + "/system/user/importData", + url: process.env.VUE_APP_BASE_API + "/jxjs/jdcx/importData", }, // 查询参数 queryParams: { @@ -387,6 +415,15 @@ export default { this.getDicts("sys_dm_shyj").then((response) => { this.qjshyjOptions = response.data; }); + this.getDicts("sys_user_sex").then((response) => { + this.xbOptions = response.data; + }); + this.getDicts("sys_dm_rjxd").then((response) => { + this.xdOptions = response.data; + }); + this.getDicts("sys_dm_rjxk").then((response) => { + this.xkOptions = response.data; + }); }, methods: { // 字典翻译 @@ -434,6 +471,18 @@ export default { qjshyjFormat(row, column) { return this.selectDictLabel(this.qjshyjOptions, row.qjshyj); }, + // 性别字典翻译 + xbFormat(row, column) { + return this.selectDictLabel(this.xbOptions, row.xb); + }, + // 学段字典翻译 + xdFormat(row, column) { + return this.selectDictLabel(this.xdOptions, row.rjxd); + }, + // 学科字典翻译 + xkFormat(row, column) { + return this.selectDictLabel(this.xkOptions, row.rjxk); + }, // 取消按钮 cancel() { this.open = false; @@ -563,31 +612,36 @@ export default { }, /** 导入按钮操作 */ handleImport() { - this.upload.title = "用户导入"; + this.upload.title = "成绩导入"; this.upload.open = true; }, /** 下载模板操作 */ - // importTemplate() { - // importTemplate().then((response) => { - // this.download(response.msg); - // }); - // }, - // // 文件上传中处理 - // handleFileUploadProgress(event, file, fileList) { - // this.upload.isUploading = true; - // }, - // // 文件上传成功处理 - // handleFileSuccess(response, file, fileList) { - // this.upload.open = false; - // this.upload.isUploading = false; - // this.$refs.upload.clearFiles(); - // this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true }); - // this.getList(); - // }, - // // 提交上传文件 - // submitFileForm() { - // this.$refs.upload.submit(); - // }, + importTemplate() { + importTemplate().then((response) => { + this.download(response.msg); + }); + }, + // 文件上传中处理 + handleFileUploadProgress(event, file, fileList) { + this.upload.isUploading = true; + }, + // 文件上传成功处理 + handleFileSuccess(response, file, fileList) { + this.upload.open = false; + this.upload.isUploading = false; + this.$refs.upload.clearFiles(); + this.$alert("成功导入:"+response.msg+"条数据。", "导入结果", { dangerouslyUseHTMLString: true }); + this.getList(); + }, + // 提交上传文件 + submitFileForm() { + if(this.upload.faide==""){ + this.$alert("请选择方案", "导入结果", { dangerouslyUseHTMLString: true }); + }else{ + this.$refs.upload.submit(); + } + + }, }, };