|
|
|
@ -2,6 +2,7 @@ package archiveapi |
|
|
|
|
|
|
|
import ( |
|
|
|
"encoding/json" |
|
|
|
"strconv" |
|
|
|
"time" |
|
|
|
|
|
|
|
"github.com/flipped-aurora/gin-vue-admin/server/commonus" |
|
|
|
@ -23,13 +24,22 @@ func (g *GraphicInformation) ArchiveFileList(c *gin.Context) { |
|
|
|
response.Result(101, err, "参数错误!请重新提交!", c) |
|
|
|
return |
|
|
|
} |
|
|
|
if requestData.ParentId == 0 { |
|
|
|
response.Result(102, err, "参数错误!请重新提交!", c) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//查询条件
|
|
|
|
whereMap := commonus.MapOut() |
|
|
|
whereMap["g_parent"] = requestData.ParentId |
|
|
|
|
|
|
|
if requestData.ParentId != 0 { |
|
|
|
whereMap["g_parent"] = requestData.ParentId |
|
|
|
} |
|
|
|
|
|
|
|
if requestData.ParentIdStr != "" { |
|
|
|
outIdVal, outIdErr := strconv.ParseInt(requestData.ParentIdStr, 10, 64) |
|
|
|
if outIdErr != nil { |
|
|
|
response.Result(102, requestData, "参数错误!请重新提交!", c) |
|
|
|
return |
|
|
|
} |
|
|
|
whereMap["g_parent"] = outIdVal |
|
|
|
} |
|
|
|
//判断集团
|
|
|
|
if requestData.Group != 0 { |
|
|
|
whereMap["g_write_group"] = requestData.Group |
|
|
|
@ -90,9 +100,18 @@ func (g *GraphicInformation) ArchiveFileList(c *gin.Context) { |
|
|
|
fileListInfo.Title = fileCont.Title |
|
|
|
fileListInfo.ColumnId = fileCont.ParentSun |
|
|
|
|
|
|
|
fileListInfo.ParentColumnId = fileCont.Parent |
|
|
|
|
|
|
|
archiveTypeCont.Id = fileCont.Parent |
|
|
|
arcTypeErrParent := archiveTypeCont.GetArchiveTypeInfo() |
|
|
|
if arcTypeErrParent == nil { |
|
|
|
fileListInfo.ParentColumnTitle = archiveTypeCont.Title |
|
|
|
} else { |
|
|
|
fileListInfo.ParentColumnTitle = "" |
|
|
|
} |
|
|
|
|
|
|
|
archiveTypeCont.Id = fileCont.ParentSun |
|
|
|
arcTypeErr := archiveTypeCont.GetArchiveTypeInfo() |
|
|
|
// fmt.Printf("%v========>%v------->%v\n", arcTypeErr, archiveTypeCont, archiveTypeCont.Title)
|
|
|
|
if arcTypeErr == nil { |
|
|
|
fileListInfo.ColumnTitle = archiveTypeCont.Title |
|
|
|
} else { |
|
|
|
@ -113,6 +132,7 @@ func (g *GraphicInformation) ArchiveFileList(c *gin.Context) { |
|
|
|
} else { |
|
|
|
fileListInfo.State = false |
|
|
|
} |
|
|
|
fileListInfo.OutId = strconv.FormatInt(fileCont.Id, 10) |
|
|
|
|
|
|
|
fileListAry = append(fileListAry, fileListInfo) |
|
|
|
} |
|
|
|
@ -215,6 +235,14 @@ func (g *GraphicInformation) GetArchiveFileInfo(c *gin.Context) { |
|
|
|
response.Result(101, getID, "参数错误!请重新提交!", c) |
|
|
|
return |
|
|
|
} |
|
|
|
if getID.OutId != "" { |
|
|
|
outIdVal, outIdErr := strconv.ParseInt(getID.OutId, 10, 64) |
|
|
|
if outIdErr != nil { |
|
|
|
response.Result(102, getID, "参数错误!请重新提交!", c) |
|
|
|
return |
|
|
|
} |
|
|
|
getID.Id = outIdVal |
|
|
|
} |
|
|
|
var archiveFileInfo archivesmodel.ArchiveFile |
|
|
|
archiveFileInfo.InitInfo() |
|
|
|
sysUserErr := global.GVA_DB_BooImgkDate.Where("g_id = ?", getID.Id).First(&archiveFileInfo).Error |
|
|
|
@ -237,6 +265,7 @@ func (g *GraphicInformation) EiteArchiveFileInfo(c *gin.Context) { |
|
|
|
response.Result(108, archiveFileInfo, "!请提交文档ID!", c) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if archiveFileInfo.Title == "" { |
|
|
|
response.Result(102, archiveFileInfo, "请输入文档标题!", c) |
|
|
|
return |
|
|
|
@ -299,6 +328,14 @@ func (g *GraphicInformation) ModifyArchiveFileInfo(c *gin.Context) { |
|
|
|
response.Result(102, arrData, "参数错误!请重新提交!", c) |
|
|
|
return |
|
|
|
} |
|
|
|
if arrData.OutId != "" { |
|
|
|
outIdVal, outIdErr := strconv.ParseInt(arrData.OutId, 10, 64) |
|
|
|
if outIdErr != nil { |
|
|
|
response.Result(102, arrData, "参数错误!请重新提交!", c) |
|
|
|
return |
|
|
|
} |
|
|
|
arrData.Id = outIdVal |
|
|
|
} |
|
|
|
if arrData.State == 0 { |
|
|
|
arrData.State = 3 |
|
|
|
} |
|
|
|
@ -448,6 +485,7 @@ func (g *GraphicInformation) GetArchiveFileAttributeList(c *gin.Context) { |
|
|
|
var bookAttrCont archiveFileAttrOutPut |
|
|
|
getMyInfo, myInfoIstrue := getUserInfo([]string{"worker_man.wm_number", "worker_man_data.wmd_name"}, map[string]interface{}{"wm_key": bookAttrVal.UserId}) |
|
|
|
bookAttrCont.Id = bookAttrVal.Id |
|
|
|
bookAttrCont.OutId = strconv.FormatInt(bookAttrVal.Id, 10) |
|
|
|
bookAttrCont.FileId = bookAttrVal.FileId |
|
|
|
bookAttrCont.UserId = bookAttrVal.UserId |
|
|
|
bookAttrCont.Time = bookAttrVal.Time |
|
|
|
|