瀏覽代碼

Merge remote-tracking branch 'origin/eta/1.0.2' into debug

Roc 1 年之前
父節點
當前提交
9131d89ac1

+ 4 - 5
controllers/data_manage/excel/custom_analysis.go

@@ -4,7 +4,6 @@ import (
 	"encoding/json"
 	"eta/eta_api/controllers"
 	"eta/eta_api/models"
-	"eta/eta_api/models/data_manage"
 	excelModel "eta/eta_api/models/data_manage/excel"
 	"eta/eta_api/models/data_manage/excel/request"
 	"eta/eta_api/models/data_manage/excel/response"
@@ -52,7 +51,7 @@ func (c *CustomAnalysisController) ExcelByName() {
 
 	excelName = utils.TrimLRStr(excelName)
 	// 获取数据详情
-	excelDetail, err := data_manage.GetNoContentExcelInfoByName(excelName, utils.CUSTOM_ANALYSIS_TABLE)
+	excelDetail, err := excelModel.GetNoContentExcelInfoByName(excelName, utils.CUSTOM_ANALYSIS_TABLE)
 	if err != nil {
 		if err.Error() == utils.ErrNoRow() {
 			br.Ret = 200
@@ -247,7 +246,7 @@ func (c *CustomAnalysisController) Save() {
 		return
 	}
 
-	excelInfo, err := data_manage.GetExcelInfoById(req.ExcelInfoId)
+	excelInfo, err := excelModel.GetExcelInfoById(req.ExcelInfoId)
 	if err != nil {
 		br.Msg = "找不到该EXCEL!"
 		br.ErrMsg = "找不到该EXCEL!err:" + err.Error()
@@ -336,7 +335,7 @@ func (c *CustomAnalysisController) BaseExcelDetail() {
 	resp := response.FindExcelInfoResp{}
 
 	// 获取数据详情
-	excelDetail, err := data_manage.GetNoContentExcelInfoByUniqueCode(uniqueCode)
+	excelDetail, err := excelModel.GetNoContentExcelInfoByUniqueCode(uniqueCode)
 	if err != nil {
 		if err.Error() == utils.ErrNoRow() {
 			br.Ret = 200
@@ -444,7 +443,7 @@ func (c *CustomAnalysisController) ExcelDataList() {
 
 	sheetList := make([]*excelModel.SheetItem, 0)
 	// 获取数据详情
-	excelDetail, err := data_manage.GetNoContentExcelInfoByUniqueCode(uniqueCode)
+	excelDetail, err := excelModel.GetNoContentExcelInfoByUniqueCode(uniqueCode)
 	if err != nil {
 		if err.Error() == utils.ErrNoRow() {
 			br.Ret = 200

+ 31 - 31
controllers/data_manage/excel_classify.go

@@ -4,7 +4,7 @@ import (
 	"encoding/json"
 	"eta/eta_api/controllers"
 	"eta/eta_api/models"
-	"eta/eta_api/models/data_manage"
+	"eta/eta_api/models/data_manage/excel"
 	"eta/eta_api/models/data_manage/request"
 	"eta/eta_api/models/data_manage/response"
 	"eta/eta_api/utils"
@@ -36,7 +36,7 @@ func (this *ExcelClassifyController) List() {
 	}
 
 	// 获取一级分类
-	rootList, err := data_manage.GetExcelClassifyByParentId(0, source)
+	rootList, err := excel.GetExcelClassifyByParentId(0, source)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取数据失败,Err:" + err.Error()
@@ -44,14 +44,14 @@ func (this *ExcelClassifyController) List() {
 	}
 
 	// 根据来源获取所有excel表格(无内容)
-	allExcelInfo, err := data_manage.GetNoContentExcelInfoAll(source)
+	allExcelInfo, err := excel.GetNoContentExcelInfoAll(source)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取表格信息失败,Err:" + err.Error()
 		return
 	}
 
-	ExcelInfoMap := make(map[int][]*data_manage.ExcelClassifyItems)
+	ExcelInfoMap := make(map[int][]*excel.ExcelClassifyItems)
 	for _, v := range allExcelInfo {
 		ExcelInfoMap[v.ExcelClassifyId] = append(ExcelInfoMap[v.ExcelClassifyId], v)
 	}
@@ -65,13 +65,13 @@ func (this *ExcelClassifyController) List() {
 	//		v.Children = items
 	//	}
 	//}
-	nodeAll := make([]*data_manage.ExcelClassifyItems, 0)
+	nodeAll := make([]*excel.ExcelClassifyItems, 0)
 	for _, v := range rootList {
-		var items []*data_manage.ExcelClassifyItems
+		var items []*excel.ExcelClassifyItems
 		if tmpItem, ok := ExcelInfoMap[v.ExcelClassifyId]; ok {
 			items = tmpItem
 		} else {
-			items = make([]*data_manage.ExcelClassifyItems, 0)
+			items = make([]*excel.ExcelClassifyItems, 0)
 		}
 		v.Children = items
 		nodeAll = append(nodeAll, v)
@@ -102,7 +102,7 @@ func (this *ExcelClassifyController) ExcelClassifyItems() {
 	if source <= 0 {
 		source = utils.EXCEL_DEFAULT
 	}
-	rootList, err := data_manage.GetExcelClassifyByParentId(0, source)
+	rootList, err := excel.GetExcelClassifyByParentId(0, source)
 	if err != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取数据失败,Err:" + err.Error()
@@ -153,7 +153,7 @@ func (this *ExcelClassifyController) AddExcelClassify() {
 	}
 
 	// 获取同级分类下存在同名分类的数量
-	count, err := data_manage.GetExcelClassifyCount(req.ExcelClassifyName, req.ParentId, source)
+	count, err := excel.GetExcelClassifyCount(req.ExcelClassifyName, req.ParentId, source)
 	if err != nil {
 		br.Msg = "判断名称是否已存在失败"
 		br.ErrMsg = "判断名称是否已存在失败,Err:" + err.Error()
@@ -165,11 +165,11 @@ func (this *ExcelClassifyController) AddExcelClassify() {
 		return
 	}
 	//获取该层级下最大的排序数
-	maxSort, err := data_manage.GetExcelClassifyMaxSort(req.ParentId)
+	maxSort, err := excel.GetExcelClassifyMaxSort(req.ParentId)
 
 	// 入库
 	timestamp := strconv.FormatInt(time.Now().UnixNano(), 10)
-	classify := &data_manage.ExcelClassify{
+	classify := &excel.ExcelClassify{
 		//ExcelClassifyId:   0,
 		ExcelClassifyName: req.ExcelClassifyName,
 		ParentId:          req.ParentId,
@@ -182,7 +182,7 @@ func (this *ExcelClassifyController) AddExcelClassify() {
 		CreateTime:        time.Now(),
 		ModifyTime:        time.Now(),
 	}
-	_, err = data_manage.AddExcelClassify(classify)
+	_, err = excel.AddExcelClassify(classify)
 	if err != nil {
 		br.Msg = "保存分类失败"
 		br.ErrMsg = "保存分类失败,Err:" + err.Error()
@@ -224,7 +224,7 @@ func (this *ExcelClassifyController) EditExcelClassify() {
 		return
 	}
 
-	item, err := data_manage.GetExcelClassifyById(req.ExcelClassifyId)
+	item, err := excel.GetExcelClassifyById(req.ExcelClassifyId)
 	if err != nil {
 		br.Msg = "保存失败"
 		br.Msg = "获取分类信息失败,Err:" + err.Error()
@@ -240,7 +240,7 @@ func (this *ExcelClassifyController) EditExcelClassify() {
 	}
 
 	// 获取同级分类下存在同名分类的数量
-	count, err := data_manage.GetExcelClassifyCount(req.ExcelClassifyName, item.ParentId, item.Source)
+	count, err := excel.GetExcelClassifyCount(req.ExcelClassifyName, item.ParentId, item.Source)
 	if err != nil {
 		br.Msg = "判断名称是否已存在失败"
 		br.ErrMsg = "判断名称是否已存在失败,Err:" + err.Error()
@@ -296,7 +296,7 @@ func (this *ExcelClassifyController) DeleteExcelClassifyCheck() {
 	var tipsMsg string
 
 	// 校验是否存在该分类
-	ExcelClassifyInfo, err := data_manage.GetExcelClassifyById(req.ExcelClassifyId)
+	ExcelClassifyInfo, err := excel.GetExcelClassifyById(req.ExcelClassifyId)
 	if err != nil {
 		if err.Error() == utils.ErrNoRow() {
 			br.Msg = "该分类不存在"
@@ -316,7 +316,7 @@ func (this *ExcelClassifyController) DeleteExcelClassifyCheck() {
 	//删除分类
 	if req.ExcelClassifyId > 0 && req.ExcelInfoId == 0 {
 		//判断表格分类下,是否含有表格
-		count, err := data_manage.GetExcelInfoCountByClassifyId(req.ExcelClassifyId)
+		count, err := excel.GetExcelInfoCountByClassifyId(req.ExcelClassifyId)
 		if err != nil {
 			br.Msg = "删除失败"
 			br.ErrMsg = "分类下是否含有指标失败,Err:" + err.Error()
@@ -394,7 +394,7 @@ func (this *ExcelClassifyController) DeleteExcelClassify() {
 	//删除分类
 	if req.ExcelClassifyId > 0 && req.ExcelInfoId == 0 {
 		//判断是否含有指标
-		count, err := data_manage.GetExcelInfoCountByClassifyId(req.ExcelClassifyId)
+		count, err := excel.GetExcelInfoCountByClassifyId(req.ExcelClassifyId)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			br.Msg = "删除失败"
 			br.ErrMsg = "判断名称是否已存在失败,Err:" + err.Error()
@@ -407,7 +407,7 @@ func (this *ExcelClassifyController) DeleteExcelClassify() {
 			return
 		}
 
-		classifyItem, err := data_manage.GetExcelClassifyById(req.ExcelClassifyId)
+		classifyItem, err := excel.GetExcelClassifyById(req.ExcelClassifyId)
 		if err != nil {
 			br.Msg = "删除失败"
 			br.ErrMsg = "获取分类失败,Err:" + err.Error()
@@ -429,7 +429,7 @@ func (this *ExcelClassifyController) DeleteExcelClassify() {
 	resp := response.AddExcelInfoResp{}
 	//删除表格
 	if req.ExcelInfoId > 0 {
-		excelInfo, err := data_manage.GetExcelInfoById(req.ExcelInfoId)
+		excelInfo, err := excel.GetExcelInfoById(req.ExcelInfoId)
 		if err != nil {
 			if err.Error() == utils.ErrNoRow() {
 				br.Msg = "表格已删除,请刷新页面"
@@ -457,7 +457,7 @@ func (this *ExcelClassifyController) DeleteExcelClassify() {
 
 		// 返回下一个表格的信息
 		{
-			var nextItem *data_manage.ExcelInfo
+			var nextItem *excel.ExcelInfo
 			var condition string
 			var pars []interface{}
 			condition += " AND excel_classify_id=? "
@@ -465,7 +465,7 @@ func (this *ExcelClassifyController) DeleteExcelClassify() {
 
 			condition += " AND (sort>? OR (sort=? AND excel_info_id<?) ) "
 			pars = append(pars, excelInfo.Sort, excelInfo.Sort, excelInfo.ExcelInfoId)
-			nextItem, err = data_manage.GetNextExcelInfoByCondition(condition, pars)
+			nextItem, err = excel.GetNextExcelInfoByCondition(condition, pars)
 			if err != nil && err.Error() != utils.ErrNoRow() {
 				br.Msg = "删除失败"
 				br.ErrMsg = "获取下一级表格信息失败,Err:" + err.Error()
@@ -474,14 +474,14 @@ func (this *ExcelClassifyController) DeleteExcelClassify() {
 
 			// 如果没找到,那么查找下一个分类的第一个表格
 			if nextItem == nil {
-				currClassifyInfo, err := data_manage.GetExcelClassifyById(excelInfo.ExcelClassifyId)
+				currClassifyInfo, err := excel.GetExcelClassifyById(excelInfo.ExcelClassifyId)
 				if err != nil && err.Error() != utils.ErrNoRow() {
 					br.Msg = "删除失败"
 					br.ErrMsg = "获取当前表格分类信息失败,Err:" + err.Error()
 					return
 				}
 
-				nextItem, err = data_manage.GetNextExcelInfo(excelInfo.ExcelClassifyId, currClassifyInfo.Sort, currClassifyInfo.Source)
+				nextItem, err = excel.GetNextExcelInfo(excelInfo.ExcelClassifyId, currClassifyInfo.Sort, currClassifyInfo.Source)
 				if err != nil && err.Error() != utils.ErrNoRow() {
 					br.Msg = "删除失败"
 					br.ErrMsg = "获取下一级表格信息失败,Err:" + err.Error()
@@ -556,7 +556,7 @@ func (this *ExcelClassifyController) ExcelClassifyMove() {
 		return
 	}
 	//判断分类是否存在
-	ExcelClassifyInfo, err := data_manage.GetExcelClassifyById(req.ClassifyId)
+	ExcelClassifyInfo, err := excel.GetExcelClassifyById(req.ClassifyId)
 	if err != nil {
 		br.Msg = "移动失败"
 		br.ErrMsg = "获取分类信息失败,Err:" + err.Error()
@@ -566,7 +566,7 @@ func (this *ExcelClassifyController) ExcelClassifyMove() {
 
 	//判断上级id是否一致,如果不一致的话,那么需要移动该分类层级
 	if ExcelClassifyInfo.ParentId != req.ParentClassifyId && req.ParentClassifyId != 0 {
-		parentExcelClassifyInfo, err := data_manage.GetExcelClassifyById(req.ParentClassifyId)
+		parentExcelClassifyInfo, err := excel.GetExcelClassifyById(req.ParentClassifyId)
 		if err != nil {
 			br.Msg = "移动失败"
 			br.ErrMsg = "获取上级分类信息失败,Err:" + err.Error()
@@ -581,7 +581,7 @@ func (this *ExcelClassifyController) ExcelClassifyMove() {
 	//如果有传入 上一个兄弟节点分类id
 	if req.PrevClassifyId > 0 {
 		//上一个兄弟节点
-		prevClassify, err := data_manage.GetExcelClassifyById(req.PrevClassifyId)
+		prevClassify, err := excel.GetExcelClassifyById(req.PrevClassifyId)
 		if err != nil {
 			br.Msg = "移动失败"
 			br.ErrMsg = "获取上一个兄弟节点分类信息失败,Err:" + err.Error()
@@ -591,7 +591,7 @@ func (this *ExcelClassifyController) ExcelClassifyMove() {
 		//如果是移动在两个兄弟节点之间
 		if req.NextClassifyId > 0 {
 			//下一个兄弟节点
-			nextClassify, err := data_manage.GetExcelClassifyById(req.NextClassifyId)
+			nextClassify, err := excel.GetExcelClassifyById(req.NextClassifyId)
 			if err != nil {
 				br.Msg = "移动失败"
 				br.ErrMsg = "获取下一个兄弟节点分类信息失败,Err:" + err.Error()
@@ -601,13 +601,13 @@ func (this *ExcelClassifyController) ExcelClassifyMove() {
 			if prevClassify.Sort == nextClassify.Sort || prevClassify.Sort == ExcelClassifyInfo.Sort {
 				//变更兄弟节点的排序
 				updateSortStr := `sort + 2`
-				_ = data_manage.UpdateExcelClassifySortByParentId(prevClassify.ParentId, prevClassify.ExcelClassifyId, prevClassify.Sort, updateSortStr)
+				_ = excel.UpdateExcelClassifySortByParentId(prevClassify.ParentId, prevClassify.ExcelClassifyId, prevClassify.Sort, updateSortStr)
 			} else {
 				//如果下一个兄弟的排序权重正好是上个兄弟节点的下一层,那么需要再加一层了
 				if nextClassify.Sort-prevClassify.Sort == 1 {
 					//变更兄弟节点的排序
 					updateSortStr := `sort + 1`
-					_ = data_manage.UpdateExcelClassifySortByParentId(prevClassify.ParentId, 0, prevClassify.Sort, updateSortStr)
+					_ = excel.UpdateExcelClassifySortByParentId(prevClassify.ParentId, 0, prevClassify.Sort, updateSortStr)
 				}
 			}
 		}
@@ -617,7 +617,7 @@ func (this *ExcelClassifyController) ExcelClassifyMove() {
 		updateCol = append(updateCol, "Sort", "ModifyTime")
 
 	} else {
-		firstClassify, err := data_manage.GetFirstExcelClassifyByParentId(ExcelClassifyInfo.ParentId)
+		firstClassify, err := excel.GetFirstExcelClassifyByParentId(ExcelClassifyInfo.ParentId)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			br.Msg = "移动失败"
 			br.ErrMsg = "获取获取当前父级分类下的排序第一条的分类信息失败,Err:" + err.Error()
@@ -627,7 +627,7 @@ func (this *ExcelClassifyController) ExcelClassifyMove() {
 		//如果该分类下存在其他分类,且第一个其他分类的排序等于0,那么需要调整排序
 		if firstClassify != nil && firstClassify.Sort == 0 {
 			updateSortStr := ` sort + 1 `
-			_ = data_manage.UpdateExcelClassifySortByParentId(firstClassify.ParentId, firstClassify.ExcelClassifyId-1, 0, updateSortStr)
+			_ = excel.UpdateExcelClassifySortByParentId(firstClassify.ParentId, firstClassify.ExcelClassifyId-1, 0, updateSortStr)
 		}
 
 		ExcelClassifyInfo.Sort = 0 //那就是排在第一位

+ 52 - 51
controllers/data_manage/excel_info.go

@@ -6,6 +6,7 @@ import (
 	"eta/eta_api/controllers"
 	"eta/eta_api/models"
 	"eta/eta_api/models/data_manage"
+	excel3 "eta/eta_api/models/data_manage/excel"
 	"eta/eta_api/models/data_manage/request"
 	"eta/eta_api/models/data_manage/response"
 	"eta/eta_api/services"
@@ -83,7 +84,7 @@ func (c *ExcelInfoController) Add() {
 		return
 	}
 
-	excelClassify, err := data_manage.GetExcelClassifyById(req.ExcelClassifyId)
+	excelClassify, err := excel3.GetExcelClassifyById(req.ExcelClassifyId)
 	if err != nil {
 		if err.Error() == utils.ErrNoRow() {
 			br.Msg = "分类不存在"
@@ -111,7 +112,7 @@ func (c *ExcelInfoController) Add() {
 	pars = append(pars, req.ExcelName)
 
 	// 获取分类下是否存在该表格名称
-	count, err := data_manage.GetExcelInfoCountByCondition(condition, pars)
+	count, err := excel3.GetExcelInfoCountByCondition(condition, pars)
 	if err != nil {
 		br.Msg = "判断表格名称是否存在失败"
 		br.ErrMsg = "判断表格名称是否存在失败,Err:" + err.Error()
@@ -171,7 +172,7 @@ func (c *ExcelInfoController) Add() {
 	}
 
 	timestamp := strconv.FormatInt(time.Now().UnixNano(), 10)
-	excelInfo := &data_manage.ExcelInfo{
+	excelInfo := &excel3.ExcelInfo{
 		//ExcelInfoId:     0,
 		ExcelName:       req.ExcelName,
 		Source:          req.Source,
@@ -188,7 +189,7 @@ func (c *ExcelInfoController) Add() {
 		CreateTime:      time.Now(),
 	}
 
-	err = data_manage.AddExcelInfo(excelInfo)
+	err = excel3.AddExcelInfo(excelInfo)
 	if err != nil {
 		br.Msg = "保存失败"
 		br.ErrMsg = "保存失败,Err:" + err.Error()
@@ -286,7 +287,7 @@ func (c *ExcelInfoController) List() {
 
 	// 筛选分类
 	if excelClassifyId > 0 {
-		_, err := data_manage.GetExcelClassifyById(excelClassifyId)
+		_, err := excel3.GetExcelClassifyById(excelClassifyId)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			br.Msg = "获取表格信息失败"
 			br.ErrMsg = "获取信息失败,GetExcelClassify,Err:" + err.Error()
@@ -310,7 +311,7 @@ func (c *ExcelInfoController) List() {
 		pars = append(pars, sysUser.AdminId)
 	}
 	//获取表格信息
-	list, err := data_manage.GetNoContentExcelListByCondition(condition, pars, startSize, pageSize)
+	list, err := excel3.GetNoContentExcelListByCondition(condition, pars, startSize, pageSize)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Success = true
 		br.Msg = "获取表格信息失败"
@@ -319,10 +320,10 @@ func (c *ExcelInfoController) List() {
 	}
 
 	if list == nil || len(list) <= 0 || (err != nil && err.Error() == utils.ErrNoRow()) {
-		list = make([]*data_manage.MyExcelInfoList, 0)
+		list = make([]*excel3.MyExcelInfoList, 0)
 	}
 	// 总数据量
-	dataCount, err := data_manage.GetExcelListCountByCondition(condition, pars)
+	dataCount, err := excel3.GetExcelListCountByCondition(condition, pars)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Msg = "获取表格列表信息失败"
 		br.ErrMsg = "获取表格列表数据总数失败,Err:" + err.Error()
@@ -443,7 +444,7 @@ func (c *ExcelInfoController) Edit() {
 		return
 	}
 
-	excelClassify, err := data_manage.GetExcelClassifyById(req.ExcelClassifyId)
+	excelClassify, err := excel3.GetExcelClassifyById(req.ExcelClassifyId)
 	if err != nil {
 		if err.Error() == utils.ErrNoRow() {
 			br.Msg = "分类不存在"
@@ -475,7 +476,7 @@ func (c *ExcelInfoController) Edit() {
 	pars = append(pars, req.ExcelName)
 
 	// 获取分类下是否存在该表格名称
-	count, err := data_manage.GetExcelInfoCountByCondition(condition, pars)
+	count, err := excel3.GetExcelInfoCountByCondition(condition, pars)
 	if err != nil {
 		br.Msg = "ETA判断表格名称是否存在失败"
 		br.ErrMsg = "判断ETA表格名称是否存在失败,Err:" + err.Error()
@@ -487,7 +488,7 @@ func (c *ExcelInfoController) Edit() {
 		return
 	}
 
-	excelInfo, err := data_manage.GetExcelInfoById(req.ExcelInfoId)
+	excelInfo, err := excel3.GetExcelInfoById(req.ExcelInfoId)
 	if err != nil {
 		br.Msg = "获取ETA表格失败"
 		br.ErrMsg = "获取ETA表格失败,Err:" + err.Error()
@@ -553,7 +554,7 @@ func (c *ExcelInfoController) Edit() {
 
 	updateExcelInfoParams := []string{"ModifyTime", "ExcelName", "ExcelType", "ExcelClassifyId", "ExcelImage", "Content"}
 
-	err = data_manage.EditExcelInfo(excelInfo, updateExcelInfoParams)
+	err = excel3.EditExcelInfo(excelInfo, updateExcelInfoParams)
 	if err != nil {
 		br.Msg = "保存失败"
 		br.ErrMsg = "保存失败,Err:" + err.Error()
@@ -567,7 +568,7 @@ func (c *ExcelInfoController) Edit() {
 
 	// 加入草稿
 	{
-		excelDraftInfo := &data_manage.ExcelDraft{
+		excelDraftInfo := &excel3.ExcelDraft{
 			//ExcelDraftId: 0,
 			ExcelId:    req.ExcelInfoId,
 			Name:       req.ExcelName,
@@ -577,7 +578,7 @@ func (c *ExcelInfoController) Edit() {
 			CreateTime: time.Now(),
 		}
 
-		err = data_manage.AddExcelDraft(excelDraftInfo)
+		err = excel3.AddExcelDraft(excelDraftInfo)
 	}
 
 	resp := response.AddExcelInfoResp{
@@ -638,7 +639,7 @@ func (c *ExcelInfoController) Move() {
 	}
 
 	//判断分类是否存在
-	_, err = data_manage.GetExcelClassifyById(req.ExcelClassifyId)
+	_, err = excel3.GetExcelClassifyById(req.ExcelClassifyId)
 	if err != nil {
 		br.Msg = "移动失败"
 		br.ErrMsg = "获取分类信息失败" + err.Error()
@@ -652,7 +653,7 @@ func (c *ExcelInfoController) Move() {
 	}
 
 	// 获取表格信息
-	excelInfo, err := data_manage.GetExcelInfoById(req.ExcelInfoId)
+	excelInfo, err := excel3.GetExcelInfoById(req.ExcelInfoId)
 	if err != nil {
 		br.Msg = "移动失败"
 		br.ErrMsg = "获取表格信息失败,Err:" + err.Error()
@@ -662,7 +663,7 @@ func (c *ExcelInfoController) Move() {
 	//如果改变了分类,那么移动该表格数据
 	if excelInfo.ExcelClassifyId != req.ExcelClassifyId {
 		//查询需要修改的分类下是否存在同一个表格名称
-		tmpExcelInfo, tmpErr := data_manage.GetExcelInfoByClassifyIdAndName(req.ExcelClassifyId, excelInfo.ExcelName)
+		tmpExcelInfo, tmpErr := excel3.GetExcelInfoByClassifyIdAndName(req.ExcelClassifyId, excelInfo.ExcelName)
 		if tmpErr != nil && tmpErr.Error() != utils.ErrNoRow() {
 			br.Msg = "移动失败"
 			br.ErrMsg = "移动失败,Err:" + tmpErr.Error()
@@ -689,7 +690,7 @@ func (c *ExcelInfoController) Move() {
 	updateCol := make([]string, 0)
 	//如果有传入 上一个兄弟节点分类id
 	if req.PrevExcelInfoId > 0 {
-		prevExcelInfo, err := data_manage.GetExcelInfoById(req.PrevExcelInfoId)
+		prevExcelInfo, err := excel3.GetExcelInfoById(req.PrevExcelInfoId)
 		if err != nil {
 			br.Msg = "移动失败"
 			br.ErrMsg = "获取上一个兄弟节点分类信息失败,Err:" + err.Error()
@@ -699,7 +700,7 @@ func (c *ExcelInfoController) Move() {
 		//如果是移动在两个兄弟节点之间
 		if req.NextExcelInfoId > 0 {
 			//下一个兄弟节点
-			nextExcelInfo, err := data_manage.GetExcelInfoById(req.NextExcelInfoId)
+			nextExcelInfo, err := excel3.GetExcelInfoById(req.NextExcelInfoId)
 			if err != nil {
 				br.Msg = "移动失败"
 				br.ErrMsg = "获取下一个兄弟节点分类信息失败,Err:" + err.Error()
@@ -709,13 +710,13 @@ func (c *ExcelInfoController) Move() {
 			if prevExcelInfo.Sort == nextExcelInfo.Sort || prevExcelInfo.Sort == excelInfo.Sort {
 				//变更兄弟节点的排序
 				updateSortStr := `sort + 2`
-				_ = data_manage.UpdateExcelInfoSortByClassifyId(prevExcelInfo.ExcelClassifyId, prevExcelInfo.Sort, prevExcelInfo.ExcelInfoId, updateSortStr)
+				_ = excel3.UpdateExcelInfoSortByClassifyId(prevExcelInfo.ExcelClassifyId, prevExcelInfo.Sort, prevExcelInfo.ExcelInfoId, updateSortStr)
 			} else {
 				//如果下一个兄弟的排序权重正好是上个兄弟节点下一层,那么需要再加一层了
 				if nextExcelInfo.Sort-prevExcelInfo.Sort == 1 {
 					//变更兄弟节点的排序
 					updateSortStr := `sort + 1`
-					_ = data_manage.UpdateExcelInfoSortByClassifyId(prevExcelInfo.ExcelClassifyId, prevExcelInfo.Sort, prevExcelInfo.ExcelInfoId, updateSortStr)
+					_ = excel3.UpdateExcelInfoSortByClassifyId(prevExcelInfo.ExcelClassifyId, prevExcelInfo.Sort, prevExcelInfo.ExcelInfoId, updateSortStr)
 				}
 			}
 		}
@@ -726,7 +727,7 @@ func (c *ExcelInfoController) Move() {
 		updateCol = append(updateCol, "Sort", "ModifyTime")
 
 	} else {
-		firstClassify, err := data_manage.GetFirstExcelInfoByClassifyId(req.ExcelClassifyId)
+		firstClassify, err := excel3.GetFirstExcelInfoByClassifyId(req.ExcelClassifyId)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			br.Msg = "移动失败"
 			br.ErrMsg = "获取获取当前父级分类下的排序第一条的分类信息失败,Err:" + err.Error()
@@ -736,7 +737,7 @@ func (c *ExcelInfoController) Move() {
 		//如果该分类下存在其他分类,且第一个其他分类的排序等于0,那么需要调整排序
 		if firstClassify != nil && firstClassify.Sort == 0 {
 			updateSortStr := ` sort + 1 `
-			_ = data_manage.UpdateExcelInfoSortByClassifyId(firstClassify.ExcelClassifyId, 0, firstClassify.ExcelInfoId-1, updateSortStr)
+			_ = excel3.UpdateExcelInfoSortByClassifyId(firstClassify.ExcelClassifyId, 0, firstClassify.ExcelInfoId-1, updateSortStr)
 		}
 
 		// 变更表格在当前分类下的排序
@@ -822,7 +823,7 @@ func (c *ExcelInfoController) Delete() {
 	}
 
 	// 获取表格信息
-	excelInfo, err := data_manage.GetExcelInfoById(req.ExcelInfoId)
+	excelInfo, err := excel3.GetExcelInfoById(req.ExcelInfoId)
 	if err != nil {
 		br.Msg = "删除失败"
 		br.ErrMsg = "获取表格信息失败,Err:" + err.Error()
@@ -851,7 +852,7 @@ func (c *ExcelInfoController) Delete() {
 
 	// 返回下一个表格的信息
 	{
-		var nextItem *data_manage.ExcelInfo
+		var nextItem *excel3.ExcelInfo
 		var condition string
 		var pars []interface{}
 		condition += " AND excel_classify_id=? "
@@ -859,7 +860,7 @@ func (c *ExcelInfoController) Delete() {
 
 		condition += " AND sort>=? "
 		pars = append(pars, excelInfo.Sort)
-		nextItem, err = data_manage.GetNextExcelInfoByCondition(condition, pars)
+		nextItem, err = excel3.GetNextExcelInfoByCondition(condition, pars)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			br.Msg = "删除失败"
 			br.ErrMsg = "获取下一级表格信息失败,Err:" + err.Error()
@@ -868,7 +869,7 @@ func (c *ExcelInfoController) Delete() {
 
 		// 如果没找到,那么查找下一个分类的第一个表格
 		if nextItem == nil {
-			currClassifyInfo, err := data_manage.GetExcelClassifyById(excelInfo.ExcelClassifyId)
+			currClassifyInfo, err := excel3.GetExcelClassifyById(excelInfo.ExcelClassifyId)
 			if err != nil && err.Error() != utils.ErrNoRow() {
 				br.Msg = "删除失败"
 				br.ErrMsg = "获取当前表格分类信息失败,Err:" + err.Error()
@@ -897,7 +898,7 @@ func (c *ExcelInfoController) Delete() {
 			//	}
 			//}
 
-			nextItem, err = data_manage.GetNextExcelInfo(excelInfo.ExcelClassifyId, currClassifyInfo.Sort, currClassifyInfo.Source)
+			nextItem, err = excel3.GetNextExcelInfo(excelInfo.ExcelClassifyId, currClassifyInfo.Sort, currClassifyInfo.Source)
 			if err != nil && err.Error() != utils.ErrNoRow() {
 				br.Msg = "删除失败"
 				br.ErrMsg = "获取下一级表格信息失败,Err:" + err.Error()
@@ -966,7 +967,7 @@ func (c *ExcelInfoController) AddDraft() {
 		return
 	}
 
-	excelClassify, err := data_manage.GetExcelClassifyById(req.ExcelClassifyId)
+	excelClassify, err := excel3.GetExcelClassifyById(req.ExcelClassifyId)
 	if err != nil {
 		if err.Error() == utils.ErrNoRow() {
 			br.Msg = "分类不存在"
@@ -994,14 +995,14 @@ func (c *ExcelInfoController) AddDraft() {
 	pars = append(pars, req.ExcelName)
 
 	// 获取分类下是否存在该表格名称
-	_, err = data_manage.GetExcelInfoById(req.ExcelInfoId)
+	_, err = excel3.GetExcelInfoById(req.ExcelInfoId)
 	if err != nil {
 		br.Msg = "判断表格名称是否存在失败"
 		br.ErrMsg = "判断表格名称是否存在失败,Err:" + err.Error()
 		return
 	}
 
-	excelDraftInfo := &data_manage.ExcelDraft{
+	excelDraftInfo := &excel3.ExcelDraft{
 		//ExcelDraftId: 0,
 		ExcelId:    req.ExcelInfoId,
 		Name:       req.ExcelName,
@@ -1011,7 +1012,7 @@ func (c *ExcelInfoController) AddDraft() {
 		CreateTime: time.Now(),
 	}
 
-	err = data_manage.AddExcelDraft(excelDraftInfo)
+	err = excel3.AddExcelDraft(excelDraftInfo)
 	if err != nil {
 		br.Msg = "保存失败"
 		br.ErrMsg = "保存失败,Err:" + err.Error()
@@ -1052,7 +1053,7 @@ func (c *ExcelInfoController) GetExcelTableData() {
 		return
 	}
 	//获取eta表格信息
-	excelInfo, err := data_manage.GetExcelInfoByUniqueCode(uniqueCode)
+	excelInfo, err := excel3.GetExcelInfoByUniqueCode(uniqueCode)
 	if err != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取ETA表格信息失败,Err:" + err.Error()
@@ -1137,7 +1138,7 @@ func (c *ExcelInfoController) GetExcelTableData() {
 }
 
 // UpdateExcelInfoFileUrl 更新excel表格的下载地址
-func UpdateExcelInfoFileUrl(excelInfo *data_manage.ExcelInfo) {
+func UpdateExcelInfoFileUrl(excelInfo *excel3.ExcelInfo) {
 	var err error
 	defer func() {
 		if err != nil {
@@ -1807,13 +1808,13 @@ func (c *ExcelInfoController) Download() {
 		br.IsSendEmail = false
 		return
 	}
-	var excelInfo *data_manage.ExcelInfo
+	var excelInfo *excel3.ExcelInfo
 	var err error
 	//获取eta表格信息
 	if excelInfoId > 0 {
-		excelInfo, err = data_manage.GetExcelInfoById(excelInfoId)
+		excelInfo, err = excel3.GetExcelInfoById(excelInfoId)
 	} else {
-		excelInfo, err = data_manage.GetExcelInfoByUniqueCode(uniqueCode)
+		excelInfo, err = excel3.GetExcelInfoByUniqueCode(uniqueCode)
 	}
 	if err != nil {
 		br.Msg = "获取失败"
@@ -1954,7 +1955,7 @@ func (c *ExcelInfoController) Copy() {
 		return
 	}
 
-	excelClassify, err := data_manage.GetExcelClassifyById(req.ExcelClassifyId)
+	excelClassify, err := excel3.GetExcelClassifyById(req.ExcelClassifyId)
 	if err != nil {
 		if err.Error() == utils.ErrNoRow() {
 			br.Msg = "分类不存在"
@@ -1974,7 +1975,7 @@ func (c *ExcelInfoController) Copy() {
 	}
 
 	// 获取原ETA表格信息
-	oldExcelInfo, err := data_manage.GetExcelInfoById(req.ExcelInfoId)
+	oldExcelInfo, err := excel3.GetExcelInfoById(req.ExcelInfoId)
 	if err != nil {
 		br.Msg = "获取ETA表格失败"
 		br.ErrMsg = "获取ETA表格失败,Err:" + err.Error()
@@ -2002,7 +2003,7 @@ func (c *ExcelInfoController) Copy() {
 		condition += " AND excel_name=? "
 		pars = append(pars, req.ExcelName)
 
-		count, err := data_manage.GetExcelInfoCountByCondition(condition, pars)
+		count, err := excel3.GetExcelInfoCountByCondition(condition, pars)
 		if err != nil {
 			br.Msg = "判断表格名称是否存在失败"
 			br.ErrMsg = "判断表格名称是否存在失败,Err:" + err.Error()
@@ -2016,7 +2017,7 @@ func (c *ExcelInfoController) Copy() {
 	}
 
 	timestamp := strconv.FormatInt(time.Now().UnixNano(), 10)
-	excelInfo := &data_manage.ExcelInfo{
+	excelInfo := &excel3.ExcelInfo{
 		//ExcelInfoId:     0,
 		ExcelName:       req.ExcelName,
 		Source:          oldExcelInfo.Source,
@@ -2033,7 +2034,7 @@ func (c *ExcelInfoController) Copy() {
 		CreateTime:      time.Now(),
 	}
 
-	err = data_manage.AddExcelInfo(excelInfo)
+	err = excel3.AddExcelInfo(excelInfo)
 	if err != nil {
 		br.Msg = "保存失败"
 		br.ErrMsg = "保存失败,Err:" + err.Error()
@@ -2183,7 +2184,7 @@ func decompressZip(src string) error {
 // FixTableData ETA1.0.2 自定义分析(生成指标数据修复)
 func FixTableData() {
 	// 获取一级分类
-	classifyList, err := data_manage.GetExcelClassifyByParentId(0, utils.EXCEL_DEFAULT)
+	classifyList, err := excel3.GetExcelClassifyByParentId(0, utils.EXCEL_DEFAULT)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		fmt.Println("数据修复失败,Err:" + err.Error())
 		return
@@ -2192,7 +2193,7 @@ func FixTableData() {
 	mixTableMap := make(map[int]int)
 	for _, v := range classifyList {
 		// 时间序列表格
-		classify := &data_manage.ExcelClassify{
+		classify := &excel3.ExcelClassify{
 			//ExcelClassifyId:   0,
 			ExcelClassifyName: v.ExcelClassifyName,
 			ParentId:          v.ParentId,
@@ -2205,11 +2206,11 @@ func FixTableData() {
 			CreateTime:        time.Now(),
 			ModifyTime:        time.Now(),
 		}
-		_, err = data_manage.AddExcelClassify(classify)
+		_, err = excel3.AddExcelClassify(classify)
 		timeTableMap[v.ExcelClassifyId] = classify.ExcelClassifyId
 
 		// 混合表格
-		classify2 := &data_manage.ExcelClassify{
+		classify2 := &excel3.ExcelClassify{
 			//ExcelClassifyId:   0,
 			ExcelClassifyName: v.ExcelClassifyName,
 			ParentId:          v.ParentId,
@@ -2222,14 +2223,14 @@ func FixTableData() {
 			CreateTime:        time.Now(),
 			ModifyTime:        time.Now(),
 		}
-		_, err = data_manage.AddExcelClassify(classify2)
+		_, err = excel3.AddExcelClassify(classify2)
 		mixTableMap[v.ExcelClassifyId] = classify2.ExcelClassifyId
 	}
 
 	// 修改时间序列表
 	{
 		// 获取时间序列表
-		timeTableExcelList, err := data_manage.GetNoContentExcelInfoAll(utils.TIME_TABLE)
+		timeTableExcelList, err := excel3.GetNoContentExcelInfoAll(utils.TIME_TABLE)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			fmt.Println("获取时间序列表列表失败,Err:" + err.Error())
 			return
@@ -2240,14 +2241,14 @@ func FixTableData() {
 			if !ok {
 				continue
 			}
-			data_manage.UpdateExcelInfoClassifyId(classifyId, v.ExcelInfoId)
+			excel3.UpdateExcelInfoClassifyId(classifyId, v.ExcelInfoId)
 		}
 	}
 
 	// 修改混合序列表
 	{
 		// 获取时间序列表
-		mixTableExcelList, err := data_manage.GetNoContentExcelInfoAll(utils.MIXED_TABLE)
+		mixTableExcelList, err := excel3.GetNoContentExcelInfoAll(utils.MIXED_TABLE)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			fmt.Println("获取时间序列表列表失败,Err:" + err.Error())
 			return
@@ -2258,7 +2259,7 @@ func FixTableData() {
 			if !ok {
 				continue
 			}
-			data_manage.UpdateExcelInfoClassifyId(classifyId, v.ExcelInfoId)
+			excel3.UpdateExcelInfoClassifyId(classifyId, v.ExcelInfoId)
 		}
 	}
 

+ 1 - 1
models/data_manage/excel_classify.go → models/data_manage/excel/excel_classify.go

@@ -1,4 +1,4 @@
-package data_manage
+package excel
 
 import (
 	"fmt"

+ 1 - 1
models/data_manage/excel_draft.go → models/data_manage/excel/excel_draft.go

@@ -1,4 +1,4 @@
-package data_manage
+package excel
 
 import (
 	"github.com/beego/beego/v2/client/orm"

+ 5 - 6
models/data_manage/excel_info.go → models/data_manage/excel/excel_info.go

@@ -1,7 +1,6 @@
-package data_manage
+package excel
 
 import (
-	"eta/eta_api/models/data_manage/excel"
 	"fmt"
 	"github.com/beego/beego/v2/client/orm"
 	"time"
@@ -299,7 +298,7 @@ func GetNoContentExcelInfoByUniqueCode(uniqueCode string) (item *MyExcelInfoList
 }
 
 // AddExcelInfoAndSheet 新增excel
-func AddExcelInfoAndSheet(excelInfo *ExcelInfo, sheetParamsList []excel.AddExcelSheetParams) (err error) {
+func AddExcelInfoAndSheet(excelInfo *ExcelInfo, sheetParamsList []AddExcelSheetParams) (err error) {
 	o, err := orm.NewOrmUsingDB("data").Begin()
 	if err != nil {
 		return
@@ -324,7 +323,7 @@ func AddExcelInfoAndSheet(excelInfo *ExcelInfo, sheetParamsList []excel.AddExcel
 		dataNum := len(sheetInfo.DataList)
 
 		//sheet信息入库
-		excelSheetInfo := &excel.ExcelSheet{
+		excelSheetInfo := &ExcelSheet{
 			ExcelSheetId: 0,
 			ExcelInfoId:  excelInfo.ExcelInfoId,
 			SheetName:    sheetInfo.SheetName,
@@ -360,7 +359,7 @@ func AddExcelInfoAndSheet(excelInfo *ExcelInfo, sheetParamsList []excel.AddExcel
 }
 
 // SaveExcelInfoAndSheet 编辑保存
-func SaveExcelInfoAndSheet(excelInfo *ExcelInfo, updateExcelInfoParam []string, sheetParamsList []excel.AddExcelSheetParams) (err error) {
+func SaveExcelInfoAndSheet(excelInfo *ExcelInfo, updateExcelInfoParam []string, sheetParamsList []AddExcelSheetParams) (err error) {
 	o, err := orm.NewOrmUsingDB("data").Begin()
 	if err != nil {
 		return
@@ -398,7 +397,7 @@ func SaveExcelInfoAndSheet(excelInfo *ExcelInfo, updateExcelInfoParam []string,
 		dataNum := len(sheetInfo.DataList)
 
 		//sheet信息入库
-		excelSheetInfo := &excel.ExcelSheet{
+		excelSheetInfo := &ExcelSheet{
 			ExcelSheetId: 0,
 			ExcelInfoId:  excelInfo.ExcelInfoId,
 			SheetName:    sheetInfo.SheetName,

+ 3 - 4
models/data_manage/excel/response/sheet.go

@@ -1,15 +1,14 @@
 package response
 
 import (
-	"eta/eta_api/models/data_manage"
 	"eta/eta_api/models/data_manage/excel"
 )
 
 // FindExcelInfoResp 根据名称获取excel的信息
 type FindExcelInfoResp struct {
-	IsFind    bool                         `description:"是否存在同名文件"`
-	ExcelInfo *data_manage.MyExcelInfoList `description:"图表详情"`
-	SheetList []*excel.SheetItem           `description:"sheet列表"`
+	IsFind    bool                   `description:"是否存在同名文件"`
+	ExcelInfo *excel.MyExcelInfoList `description:"图表详情"`
+	SheetList []*excel.SheetItem     `description:"sheet列表"`
 }
 
 // AddExcelInfoResp 添加excel表格的返回

+ 4 - 2
models/data_manage/response/excel_classify.go

@@ -1,9 +1,11 @@
 package response
 
-import "eta/eta_api/models/data_manage"
+import (
+	"eta/eta_api/models/data_manage/excel"
+)
 
 type ExcelClassifyListResp struct {
-	AllNodes []*data_manage.ExcelClassifyItems
+	AllNodes []*excel.ExcelClassifyItems
 }
 
 type ExcelClassifyDeleteCheckResp struct {

+ 4 - 4
models/data_manage/response/excel_info.go

@@ -1,7 +1,7 @@
 package response
 
 import (
-	"eta/eta_api/models/data_manage"
+	excel2 "eta/eta_api/models/data_manage/excel"
 	"eta/eta_api/models/data_manage/request"
 	"eta/eta_api/services/excel"
 	"github.com/rdlucklib/rdluck_tools/paging"
@@ -17,7 +17,7 @@ type AddExcelInfoResp struct {
 // ExcelListResp 表格列表返回数据
 type ExcelListResp struct {
 	Paging *paging.PagingItem
-	List   []*data_manage.MyExcelInfoList
+	List   []*excel2.MyExcelInfoList
 }
 
 // ExcelTableDetailResp  excel表格详情
@@ -43,8 +43,8 @@ type TableDataItem struct {
 
 // TableDetailResp  excel表格详情
 type TableDetailResp struct {
-	ExcelInfo data_manage.ExcelInfo `description:"表格基础信息"`
-	TableData request.TableDataReq  `description:"表格内容"`
+	ExcelInfo excel2.ExcelInfo     `description:"表格基础信息"`
+	TableData request.TableDataReq `description:"表格内容"`
 }
 
 // ExcelInfoDetail excel表格详情(前端使用)

+ 5 - 5
models/db.go

@@ -421,10 +421,10 @@ func initEtaTrial() {
 // initExcel 初始化EXCEL
 func initExcel() {
 	orm.RegisterModel(
-		new(data_manage.ExcelClassify), //ETA excel表格分类
-		new(data_manage.ExcelInfo),     //ETA excel表格
-		new(data_manage.ExcelDraft),    //ETA excel表格草稿
-		new(excel.ExcelSheet),          //ETA excel sheet
-		new(excel.ExcelSheetData),      //ETA excel sheet data
+		new(excel.ExcelClassify),  //ETA excel表格分类
+		new(excel.ExcelInfo),      //ETA excel表格
+		new(excel.ExcelDraft),     //ETA excel表格草稿
+		new(excel.ExcelSheet),     //ETA excel sheet
+		new(excel.ExcelSheetData), //ETA excel sheet data
 	)
 }

+ 19 - 20
services/data/excel/custom_analysis.go

@@ -3,7 +3,6 @@ package excel
 import (
 	"encoding/json"
 	"errors"
-	"eta/eta_api/models/data_manage"
 	"eta/eta_api/models/data_manage/excel"
 	"eta/eta_api/models/data_manage/excel/request"
 	"eta/eta_api/models/system"
@@ -12,8 +11,10 @@ import (
 	"time"
 )
 
+var cellSplitNum = 10000 // 基础分割单元格数
+
 // AddCustomAnalysisTable 添加自定义分析表格
-func AddCustomAnalysisTable(excelName, content, excelImage string, excelClassifyId int, sysUser *system.Admin) (excelInfo *data_manage.ExcelInfo, err error, errMsg string, isSendEmail bool) {
+func AddCustomAnalysisTable(excelName, content, excelImage string, excelClassifyId int, sysUser *system.Admin) (excelInfo *excel.ExcelInfo, err error, errMsg string, isSendEmail bool) {
 	isSendEmail = true
 
 	contentByte := []byte(content)
@@ -33,7 +34,7 @@ func AddCustomAnalysisTable(excelName, content, excelImage string, excelClassify
 		return
 	}
 
-	excelClassify, err := data_manage.GetExcelClassifyById(excelClassifyId)
+	excelClassify, err := excel.GetExcelClassifyById(excelClassifyId)
 	if err != nil {
 		if err.Error() == utils.ErrNoRow() {
 			errMsg = "分类不存在"
@@ -70,7 +71,7 @@ func AddCustomAnalysisTable(excelName, content, excelImage string, excelClassify
 		pars = append(pars, excelName)
 
 		// 获取分类下是否存在该表格名称
-		count, tmpErr := data_manage.GetExcelInfoCountByCondition(condition, pars)
+		count, tmpErr := excel.GetExcelInfoCountByCondition(condition, pars)
 		if tmpErr != nil {
 			errMsg = "判断表格名称是否存在失败"
 			err = errors.New("判断表格名称是否存在失败,Err:" + tmpErr.Error())
@@ -86,7 +87,7 @@ func AddCustomAnalysisTable(excelName, content, excelImage string, excelClassify
 
 	timestamp := strconv.FormatInt(time.Now().UnixNano(), 10)
 	// 表格
-	excelInfo = &data_manage.ExcelInfo{
+	excelInfo = &excel.ExcelInfo{
 		//ExcelInfoId:     0,
 		ExcelName: excelName,
 		Source:    utils.CUSTOM_ANALYSIS_TABLE,
@@ -104,7 +105,6 @@ func AddCustomAnalysisTable(excelName, content, excelImage string, excelClassify
 	}
 
 	addSheetList := make([]excel.AddExcelSheetParams, 0)
-	splitNum := 2000 // 基础分割单元格数
 
 	// sheet处理
 	sheetNameMap := make(map[string]string)
@@ -140,8 +140,8 @@ func AddCustomAnalysisTable(excelName, content, excelImage string, excelClassify
 
 		lenCellData := len(sheetInfo.Celldata)
 
-		splitLen := lenCellData / splitNum
-		residue := lenCellData % splitNum
+		splitLen := lenCellData / cellSplitNum
+		residue := lenCellData % cellSplitNum
 		if residue > 0 {
 			splitLen += 1
 		}
@@ -149,8 +149,8 @@ func AddCustomAnalysisTable(excelName, content, excelImage string, excelClassify
 		sheetDataList := make([]*excel.ExcelSheetData, 0)
 		for i := 0; i < splitLen; i++ {
 
-			startRow := i * splitNum
-			endRow := (i + 1) * splitNum
+			startRow := i * cellSplitNum
+			endRow := (i + 1) * cellSplitNum
 			if i == splitLen-1 && residue > 0 {
 				endRow = lenCellData
 			}
@@ -177,13 +177,13 @@ func AddCustomAnalysisTable(excelName, content, excelImage string, excelClassify
 		addSheetList = append(addSheetList, addSheetItem)
 	}
 
-	err = data_manage.AddExcelInfoAndSheet(excelInfo, addSheetList)
+	err = excel.AddExcelInfoAndSheet(excelInfo, addSheetList)
 
 	return
 }
 
 // SaveCustomAnalysisTable 编辑自定义分析表格
-func SaveCustomAnalysisTable(excelInfo *data_manage.ExcelInfo, excelName, content, excelImage string, excelClassifyId int, sheetOpList []request.SheetOp) (err error, errMsg string, isSendEmail bool) {
+func SaveCustomAnalysisTable(excelInfo *excel.ExcelInfo, excelName, content, excelImage string, excelClassifyId int, sheetOpList []request.SheetOp) (err error, errMsg string, isSendEmail bool) {
 	isSendEmail = true
 
 	contentByte := []byte(content)
@@ -211,7 +211,7 @@ func SaveCustomAnalysisTable(excelInfo *data_manage.ExcelInfo, excelName, conten
 	//	return
 	//}
 
-	excelClassify, err := data_manage.GetExcelClassifyById(excelClassifyId)
+	excelClassify, err := excel.GetExcelClassifyById(excelClassifyId)
 	if err != nil {
 		if err.Error() == utils.ErrNoRow() {
 			errMsg = "分类不存在"
@@ -248,7 +248,7 @@ func SaveCustomAnalysisTable(excelInfo *data_manage.ExcelInfo, excelName, conten
 		pars = append(pars, excelName)
 
 		// 获取分类下是否存在该表格名称
-		count, tmpErr := data_manage.GetExcelInfoCountByCondition(condition, pars)
+		count, tmpErr := excel.GetExcelInfoCountByCondition(condition, pars)
 		if tmpErr != nil {
 			errMsg = "判断表格名称是否存在失败"
 			err = errors.New("判断表格名称是否存在失败,Err:" + tmpErr.Error())
@@ -306,7 +306,6 @@ func SaveCustomAnalysisTable(excelInfo *data_manage.ExcelInfo, excelName, conten
 	updateExcelInfoParam := []string{"ExcelName", "ExcelClassifyId", "ExcelImage", "ModifyTime"}
 
 	addSheetList := make([]excel.AddExcelSheetParams, 0)
-	splitNum := 2000 // 基础分割单元格数
 
 	// sheet处理
 	sheetNameMap := make(map[string]string)
@@ -342,8 +341,8 @@ func SaveCustomAnalysisTable(excelInfo *data_manage.ExcelInfo, excelName, conten
 
 		lenCellData := len(sheetInfo.Celldata)
 
-		splitLen := lenCellData / splitNum
-		residue := lenCellData % splitNum
+		splitLen := lenCellData / cellSplitNum
+		residue := lenCellData % cellSplitNum
 		if residue > 0 {
 			splitLen += 1
 		}
@@ -351,8 +350,8 @@ func SaveCustomAnalysisTable(excelInfo *data_manage.ExcelInfo, excelName, conten
 		sheetDataList := make([]*excel.ExcelSheetData, 0)
 		for i := 0; i < splitLen; i++ {
 
-			startRow := i * splitNum
-			endRow := (i + 1) * splitNum
+			startRow := i * cellSplitNum
+			endRow := (i + 1) * cellSplitNum
 			if i == splitLen-1 && residue > 0 {
 				endRow = lenCellData
 			}
@@ -379,7 +378,7 @@ func SaveCustomAnalysisTable(excelInfo *data_manage.ExcelInfo, excelName, conten
 		addSheetList = append(addSheetList, addSheetItem)
 	}
 
-	err = data_manage.SaveExcelInfoAndSheet(excelInfo, updateExcelInfoParam, addSheetList)
+	err = excel.SaveExcelInfoAndSheet(excelInfo, updateExcelInfoParam, addSheetList)
 
 	return
 }

+ 2 - 1
services/data/excel/excel_info.go

@@ -4,6 +4,7 @@ import (
 	"encoding/json"
 	"errors"
 	"eta/eta_api/models/data_manage"
+	"eta/eta_api/models/data_manage/excel"
 	"eta/eta_api/models/data_manage/request"
 	"eta/eta_api/models/data_manage/response"
 	"eta/eta_api/models/system"
@@ -22,7 +23,7 @@ import (
 func GetExcelDetailInfoByExcelInfoId(excelInfoId int) (excelDetail response.ExcelInfoDetail, errMsg string, err error) {
 	errMsg = `获取失败`
 	//获取eta表格信息
-	excelInfo, err := data_manage.GetExcelInfoById(excelInfoId)
+	excelInfo, err := excel.GetExcelInfoById(excelInfoId)
 	if err != nil {
 		err = errors.New("获取ETA表格信息失败,Err:" + err.Error())
 		if err.Error() == utils.ErrNoRow() {