|
|
@@ -2,6 +2,7 @@ package document
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
+ "log"
|
|
|
"time"
|
|
|
|
|
|
"dashoo.cn/backend/api/business/documentmanage"
|
|
|
@@ -47,6 +48,15 @@ func (this *DocumentController) GetDocumentList() {
|
|
|
if Type != "" {
|
|
|
where = where + " and Type = 1 "
|
|
|
}
|
|
|
+ rangeType := ""
|
|
|
+ if this.User.IsCompanyUser == 0 && this.User.UnitId > 0 {
|
|
|
+ // 管理单位用户全部能看
|
|
|
+ rangeType = "1,2,3"
|
|
|
+ } else {
|
|
|
+ // 企业用户通用和外部
|
|
|
+ rangeType = "1,3"
|
|
|
+ }
|
|
|
+ where = where + " and RangeType in (" + rangeType + ")"
|
|
|
|
|
|
svc := documentmanage.GetDocumentmanageService(utils.DBE)
|
|
|
var list []documentmanage.DocumentInfo
|
|
|
@@ -112,7 +122,33 @@ func (this *DocumentController) GetFolderList() {
|
|
|
func (this *DocumentController) GetDocumentNameAndTime() {
|
|
|
colName := this.GetString("colName")
|
|
|
rangeType := this.GetString("RangeType")
|
|
|
+ rangeType = "1,3" // 仅未登录系统时拉取,通用和外部
|
|
|
+ svc := documentmanage.GetDocumentmanageService(utils.DBE)
|
|
|
+ var list []documentmanage.DocumentNameTimeInfo
|
|
|
+ tableName := DocumentInfoName
|
|
|
+ list = svc.GetDocumentNameAndTime(tableName, colName, rangeType)
|
|
|
+
|
|
|
+ this.Data["json"] = &list
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取文件夹
|
|
|
+// @Description get user by token
|
|
|
+// @Success 200 {object} models.Userblood
|
|
|
+// @router /get-res-by-user [get]
|
|
|
+func (this *DocumentController) GetDocumentNameAndTimeInSys() {
|
|
|
+ colName := this.GetString("colName")
|
|
|
+ rangeType := this.GetString("RangeType")
|
|
|
|
|
|
+ // 1通用 2内部 3外部
|
|
|
+ log.Print(this.User)
|
|
|
+ if this.User.IsCompanyUser == 0 && this.User.UnitId > 0 {
|
|
|
+ // 管理单位用户全部能看
|
|
|
+ rangeType = "1,2,3"
|
|
|
+ } else {
|
|
|
+ // 企业用户通用和外部
|
|
|
+ rangeType = "1,3"
|
|
|
+ }
|
|
|
svc := documentmanage.GetDocumentmanageService(utils.DBE)
|
|
|
var list []documentmanage.DocumentNameTimeInfo
|
|
|
tableName := DocumentInfoName
|