From 03f9fc6f7cea810469c22913214d11a3bc8d2ffc Mon Sep 17 00:00:00 2001 From: huanghai <10402852@qq.com> Date: Fri, 25 Sep 2020 17:13:08 +0800 Subject: [PATCH] 'commit' --- dsBaseRpc/Config/ExcelStyle/tableStyleInt.json | 2 +- .../BaseStudent/BaseStudentDao/BaseStudentDao.go | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dsBaseRpc/Config/ExcelStyle/tableStyleInt.json b/dsBaseRpc/Config/ExcelStyle/tableStyleInt.json index 29325b37..2d117888 100644 --- a/dsBaseRpc/Config/ExcelStyle/tableStyleInt.json +++ b/dsBaseRpc/Config/ExcelStyle/tableStyleInt.json @@ -8,7 +8,7 @@ "horizontal": "center", "vertical": "center" }, - "number_format": 1, + "number_format": 3, "border": [ { "type": "left", diff --git a/dsBaseRpc/RpcService/BaseStudent/BaseStudentDao/BaseStudentDao.go b/dsBaseRpc/RpcService/BaseStudent/BaseStudentDao/BaseStudentDao.go index e118b3ed..e9282cc2 100644 --- a/dsBaseRpc/RpcService/BaseStudent/BaseStudentDao/BaseStudentDao.go +++ b/dsBaseRpc/RpcService/BaseStudent/BaseStudentDao/BaseStudentDao.go @@ -191,14 +191,20 @@ func ExportStudentInfoExcel(targetPath string, bureauId string, ExportExcelStatu //3、入学年份+班号的有效性 for k := 2 + ExcelUtil.HiddenRows; k <= 5000+ExcelUtil.HiddenRows; k++ { + + //设置单元格格式 + cName:="B"+CommonUtil.ConvertIntToString(k) + f.SetCellStyle(SheetName, cName, cName, tableStyleIntStyle) + //入学年份 dvRange := excelize.NewDataValidation(true) dvRange.Sqref = "B" + CommonUtil.ConvertIntToString(k) + ":B" + CommonUtil.ConvertIntToString(k) _ = dvRange.SetRange(2014, 2030, excelize.DataValidationTypeWhole, excelize.DataValidationOperatorBetween) dvRange.SetError(excelize.DataValidationErrorStyleStop, "入学年份校验错误", "系统只支持2014-2030年度的班级!") _ = f.AddDataValidation(SheetName, dvRange) + //设置单元格格式 - cName:="B"+CommonUtil.ConvertIntToString(k) + cName="C"+CommonUtil.ConvertIntToString(k) f.SetCellStyle(SheetName, cName, cName, tableStyleIntStyle) //班号 @@ -207,9 +213,6 @@ func ExportStudentInfoExcel(targetPath string, bureauId string, ExportExcelStatu _ = dvRange.SetRange(1, 99, excelize.DataValidationTypeWhole, excelize.DataValidationOperatorBetween) dvRange.SetError(excelize.DataValidationErrorStyleStop, "班号录入错误", "系统只支持1-99的班号!") _ = f.AddDataValidation(SheetName, dvRange) - //设置单元格格式 - cName="C"+CommonUtil.ConvertIntToString(k) - f.SetCellStyle(SheetName, cName, cName, tableStyleIntStyle) } //4、添加是否的下拉框K--->P for i := 11; i <= 16; i++ {