|
@@ -1266,7 +1266,7 @@ func getBalanceDataListStartDateAndValue(dataList []*data_manage.EdbDataList) (s
|
|
|
}
|
|
|
|
|
|
// AddBalanceStaticExcel 另存为和存为静态表以及子表的复制都调用该接口
|
|
|
-func AddBalanceStaticExcel(oldExcelInfo *excelModel.ExcelInfo, versionName string, sysUser *system.Admin, parentId, relExcelInfoId, balanceType int, childExcelList []*excelModel.ExcelInfo, pingNameFlag bool, excelDataMap map[int]map[int][]*data_manage.EdbDataList) (excelInfo *excelModel.ExcelInfo, err error, errMsg string, isSendEmail bool) {
|
|
|
+func AddBalanceStaticExcel(oldExcelInfo *excelModel.ExcelInfo, excelClassifyId int, versionName string, sysUser *system.Admin, parentId, relExcelInfoId, balanceType int, childExcelList []*excelModel.ExcelInfo, pingNameFlag bool, excelDataMap map[int]map[int][]*data_manage.EdbDataList) (excelInfo *excelModel.ExcelInfo, err error, errMsg string, isSendEmail bool) {
|
|
|
isSendEmail = true
|
|
|
|
|
|
versionName = utils.TrimLRStr(versionName)
|
|
@@ -1275,7 +1275,7 @@ func AddBalanceStaticExcel(oldExcelInfo *excelModel.ExcelInfo, versionName strin
|
|
|
if balanceType == 1 && versionName != "" {
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
- condition += " AND rel_excel_info_id=? AND balance_type=1"
|
|
|
+ condition += " AND rel_excel_info_id=? AND balance_type=1 AND parent_id=0"
|
|
|
pars = append(pars, oldExcelInfo.ExcelInfoId)
|
|
|
|
|
|
condition += " AND version_name=? "
|
|
@@ -1283,12 +1283,12 @@ func AddBalanceStaticExcel(oldExcelInfo *excelModel.ExcelInfo, versionName strin
|
|
|
|
|
|
count, tmpErr := excelModel.GetExcelInfoCountByCondition(condition, pars)
|
|
|
if tmpErr != nil {
|
|
|
- errMsg = "查询版本号失败"
|
|
|
+ errMsg = "查询版本名称失败"
|
|
|
err = tmpErr
|
|
|
return
|
|
|
}
|
|
|
if count > 0 {
|
|
|
- errMsg = "表格版本号已存在,请重新填写版本号"
|
|
|
+ errMsg = "表格版本名称已存在,请重新填写版本名称"
|
|
|
err = errors.New(errMsg)
|
|
|
isSendEmail = false
|
|
|
return
|
|
@@ -1310,7 +1310,7 @@ func AddBalanceStaticExcel(oldExcelInfo *excelModel.ExcelInfo, versionName strin
|
|
|
Source: oldExcelInfo.Source,
|
|
|
ExcelType: oldExcelInfo.ExcelType,
|
|
|
UniqueCode: utils.MD5(utils.EXCEL_DATA_PREFIX + "_" + timestamp),
|
|
|
- ExcelClassifyId: oldExcelInfo.ExcelClassifyId,
|
|
|
+ ExcelClassifyId: excelClassifyId,
|
|
|
SysUserId: sysUser.AdminId,
|
|
|
SysUserRealName: sysUser.RealName,
|
|
|
Content: content,
|
|
@@ -1351,7 +1351,7 @@ func AddBalanceStaticExcel(oldExcelInfo *excelModel.ExcelInfo, versionName strin
|
|
|
}
|
|
|
if parentId == 0 && len(childExcelList) > 0 {
|
|
|
for _, childExcelInfo := range childExcelList {
|
|
|
- _, err, errMsg, isSendEmail = AddBalanceStaticExcel(childExcelInfo, versionName, sysUser, excelInfo.ExcelInfoId, relExcelInfoId, balanceType, []*excelModel.ExcelInfo{}, false, excelDataMap)
|
|
|
+ _, err, errMsg, isSendEmail = AddBalanceStaticExcel(childExcelInfo, excelClassifyId, versionName, sysUser, excelInfo.ExcelInfoId, relExcelInfoId, balanceType, []*excelModel.ExcelInfo{}, false, excelDataMap)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -1604,7 +1604,7 @@ func CopyBalanceExcel(oldExcelInfo *excelModel.ExcelInfo, excelClassifyId int, e
|
|
|
}
|
|
|
// 查询出每个子表的内容,并将内容转为静态版本
|
|
|
excelDataMap := make(map[int]map[int][]*data_manage.EdbDataList)
|
|
|
- excelInfo, err, errMsg, isSendEmail = AddBalanceStaticExcel(oldExcelInfo, "", sysUser, 0, 0, 0, childExcelList, false, excelDataMap)
|
|
|
+ excelInfo, err, errMsg, isSendEmail = AddBalanceStaticExcel(oldExcelInfo, excelClassifyId, "", sysUser, 0, 0, 0, childExcelList, false, excelDataMap)
|
|
|
if err != nil {
|
|
|
errMsg = "复制动态表失败"
|
|
|
err = fmt.Errorf("复制动态表失败 %s", err.Error())
|
|
@@ -1655,7 +1655,7 @@ func CopyBalanceExcel(oldExcelInfo *excelModel.ExcelInfo, excelClassifyId int, e
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- _, err, errMsg, isSendEmail = AddBalanceStaticExcel(staticExcelInfo, staticExcelInfo.VersionName, sysUser, 0, excelInfo.ExcelInfoId, 1, childList, false, excelDataMap)
|
|
|
+ _, err, errMsg, isSendEmail = AddBalanceStaticExcel(staticExcelInfo, excelClassifyId, staticExcelInfo.VersionName, sysUser, 0, excelInfo.ExcelInfoId, 1, childList, false, excelDataMap)
|
|
|
if err != nil {
|
|
|
errMsg = "复制动态表失败"
|
|
|
err = fmt.Errorf("复制动态表失败 %s", err.Error())
|