|
|
package Test
|
|
|
|
|
|
import (
|
|
|
"dsBaseRpc/RpcService/BaseStudent/BaseStudentDao"
|
|
|
"fmt"
|
|
|
"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())
|
|
|
//}
|
|
|
}
|
|
|
|
|
|
func TestImportTeacher(t *testing.T) {
|
|
|
////哪个单位
|
|
|
//bureauId := "042F28BE-296C-40F4-8AD4-A68A6D852CF0"
|
|
|
////文件在哪里
|
|
|
//fileName := "E:\\Work\\dsMin\\dsBaseWeb\\Html\\ExcelTemp\\" + bureauId + ".xlsx"
|
|
|
//success, message, err := BaseTeacherDao.ImportTeacherInfoExcel(fileName, bureauId)
|
|
|
//if err != nil {
|
|
|
// fmt.Println(err.Error())
|
|
|
//}
|
|
|
//fmt.Println(success)
|
|
|
//fmt.Println(message)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
功能:测试导出教师EXCEL
|
|
|
作者:黄海
|
|
|
时间:2020-06-05
|
|
|
*/
|
|
|
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)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
功能:测试导出学生EXCEL
|
|
|
作者:黄海
|
|
|
时间:2020-06-05
|
|
|
*/
|
|
|
func TestStudentExportExcel(t *testing.T) {
|
|
|
////哪个单位
|
|
|
//bureauId := "7ED4080B-924F-40F0-9004-881A2B833E44"
|
|
|
////文件在哪里
|
|
|
//fileName := "E:\\Work\\dsMin\\dsBaseWeb\\Html\\ExcelTemp\\" + bureauId + ".xlsx"
|
|
|
//BaseStudentDao.ExportStudentInfoExcel(fileName, bureauId, 1, []string{})
|
|
|
}
|
|
|
|
|
|
func TestImportStudent(t *testing.T) {
|
|
|
//哪个单位
|
|
|
bureauId := "4763978F-D464-4A3F-93D4-9857668D10A7"
|
|
|
//文件在哪里
|
|
|
fileName := `E:\Work\dsMin\dsBaseWeb\Html\ExcelTemp\` + bureauId + ".xlsx"
|
|
|
success, message, err := BaseStudentDao.ImportStudentInfoExcel(fileName, bureauId,"B4A8ED19-84DB-4388-BD3D-25BACD463119","10.10.24.100")
|
|
|
if err != nil {
|
|
|
fmt.Println(err.Error())
|
|
|
}
|
|
|
fmt.Println(success)
|
|
|
fmt.Println(message)
|
|
|
}
|