|
@@ -682,47 +682,3 @@ func GetChildExcelInfoByParentId(parentId int) (items []*ExcelInfo, err error) {
|
|
|
_, err = o.Raw(sql, parentId).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
-// ExcelInfoVersionRename 平衡表版本号重命名
|
|
|
-func ExcelInfoVersionRename(excelInfo *ExcelInfo, updateExcelInfoParams []string, excelEdbMappingList []*ExcelEdbMapping) (err error) {
|
|
|
- o, err := orm.NewOrmUsingDB("data").Begin()
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
- }
|
|
|
- defer func() {
|
|
|
- if err != nil {
|
|
|
- _ = o.Rollback()
|
|
|
- } else {
|
|
|
- _ = o.Commit()
|
|
|
- }
|
|
|
- }()
|
|
|
-
|
|
|
- // ETA表格信息变更
|
|
|
- _, err = o.Update(excelInfo, updateExcelInfoParams...)
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- // 同步更新图表数据
|
|
|
- //更新父级分类时,同时更新子集分类
|
|
|
- if excelInfo.Source == utils.BALANCE_TABLE && excelInfo.ParentId == 0 {
|
|
|
- // 同步更新子表分类
|
|
|
- sql := `UPDATE FROM excel_info set excel_classify_id = ? WHERE parent_id=? `
|
|
|
- _, err = o.Raw(sql, excelInfo.ExcelClassifyId, excelInfo.ExcelInfoId).Exec()
|
|
|
- }
|
|
|
- // 删除关系表
|
|
|
- sql := `DELETE FROM excel_edb_mapping WHERE excel_info_id=? `
|
|
|
- _, err = o.Raw(sql, excelInfo.ExcelInfoId).Exec()
|
|
|
-
|
|
|
- // excel与指标的关联关系
|
|
|
- dataNum := len(excelEdbMappingList)
|
|
|
- if dataNum > 0 {
|
|
|
- for k, v := range excelEdbMappingList {
|
|
|
- v.ExcelInfoId = excelInfo.ExcelInfoId
|
|
|
- excelEdbMappingList[k] = v
|
|
|
- }
|
|
|
- _, err = o.InsertMulti(dataNum, excelEdbMappingList)
|
|
|
- }
|
|
|
-
|
|
|
- return
|
|
|
-}
|