|
|
|
@ -1,24 +1,21 @@
|
|
|
|
|
package Test
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"dsBaseRpc/Const"
|
|
|
|
|
"dsBaseRpc/RpcService/BaseStudent/BaseStudentDao"
|
|
|
|
|
"dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao"
|
|
|
|
|
"github.com/360EntSecGroup-Skylar/excelize/v2"
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestStyle(t *testing.T) {
|
|
|
|
|
excelPath := `E:\Work\dsMin\dsBaseRpc\Config\ImportExcelTemplate\teacher.xlsx`
|
|
|
|
|
tPath := `E:\Work\dsMin\dsBaseRpc\Config\ImportExcelTemplate\teacher2222.xlsx`
|
|
|
|
|
f, _ := excelize.OpenFile(excelPath)
|
|
|
|
|
|
|
|
|
|
style, _ := f.GetCellStyle("教工信息", Const.RedCell)
|
|
|
|
|
f.SetCellStyle("教工信息", "A202", "A202", style)
|
|
|
|
|
|
|
|
|
|
if err := f.SaveAs(tPath); err != nil {
|
|
|
|
|
println(err.Error())
|
|
|
|
|
}
|
|
|
|
|
//excelPath := `E:\Work\dsMin\dsBaseRpc\Config\ImportExcelTemplate\teacher.xlsx`
|
|
|
|
|
//tPath := `E:\Work\dsMin\dsBaseRpc\Config\ImportExcelTemplate\teacher2222.xlsx`
|
|
|
|
|
//f, _ := excelize.OpenFile(excelPath)
|
|
|
|
|
//
|
|
|
|
|
//style, _ := f.GetCellStyle("教工信息", Const.RedCell)
|
|
|
|
|
//f.SetCellStyle("教工信息", "A202", "A202", style)
|
|
|
|
|
//
|
|
|
|
|
//if err := f.SaveAs(tPath); err != nil {
|
|
|
|
|
// println(err.Error())
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestImportTeacher(t *testing.T) {
|
|
|
|
@ -41,10 +38,10 @@ func TestImportTeacher(t *testing.T) {
|
|
|
|
|
*/
|
|
|
|
|
func TestTeacherExportExcel(t *testing.T) {
|
|
|
|
|
//哪个单位
|
|
|
|
|
bureauId := "042F28BE-296C-40F4-8AD4-A68A6D852CF0"
|
|
|
|
|
//文件在哪里
|
|
|
|
|
fileName := "E:\\Work\\dsMin\\dsBaseWeb\\Html\\ExcelTemp\\" + bureauId + ".xlsx"
|
|
|
|
|
BaseTeacherDao.ExportTeacherInfoExcel(fileName, bureauId, 1)
|
|
|
|
|
//bureauId := "042F28BE-296C-40F4-8AD4-A68A6D852CF0"
|
|
|
|
|
////文件在哪里
|
|
|
|
|
//fileName := "E:\\Work\\dsMin\\dsBaseWeb\\Html\\ExcelTemp\\" + bureauId + ".xlsx"
|
|
|
|
|
//BaseTeacherDao.ExportTeacherInfoExcel(fileName, bureauId, 1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -54,7 +51,7 @@ func TestTeacherExportExcel(t *testing.T) {
|
|
|
|
|
*/
|
|
|
|
|
func TestStudentExportExcel(t *testing.T) {
|
|
|
|
|
//哪个单位
|
|
|
|
|
bureauId := "042F28BE-296C-40F4-8AD4-A68A6D852CF0"
|
|
|
|
|
bureauId := "7ED4080B-924F-40F0-9004-881A2B833E44"
|
|
|
|
|
//文件在哪里
|
|
|
|
|
fileName := "E:\\Work\\dsMin\\dsBaseWeb\\Html\\ExcelTemp\\" + bureauId + ".xlsx"
|
|
|
|
|
BaseStudentDao.ExportStudentInfoExcel(fileName, bureauId, 1, []string{})
|
|
|
|
|