package oilsupplier import ( "dashoo.cn/backend/api/business/oilsupplier/suppliercertsub" "dashoo.cn/business2/parameter" "encoding/json" "strconv" "strings" //"strings" //"time" //"fmt" "dashoo.cn/backend/api/business/oilsupplier/supplierfile" . "dashoo.cn/backend/api/controllers" "dashoo.cn/utils" ) type SupplierfileController struct { BaseController } // @Title 文件上传 // @Description get user by tokenaddsubfile // @Success 200 {object} models.Userblood // @router /filelistall [get] func (this *SupplierfileController) AllFileList() { page := this.GetPageInfoForm() var list []supplierfile.OilSupplierFile svc := supplierfile.GetSupplierfileService(utils.DBE) where := " 1=1" orderby := "Id" asc := true Order := this.GetString("Order") Prop := this.GetString("Prop") if Order != "" && Prop != "" { orderby = Prop if Order == "asc" { asc = true } } SupplierId := this.GetString("SupplierId") if SupplierId != "" { where = where + " and SupplierId = '" + SupplierId + "'" } SupplierTypeCode := this.GetString("SupplierTypeCode") AppendId := this.GetString("AppendId") if SupplierTypeCode != "" { where = where + " and SupplierCertSubId= "+ AppendId +" and SupplierTypeCode in ( '000', '" + SupplierTypeCode + "')" } total := svc.GetPagingEntitiesWithoutAccCode(page.CurrentPage, page.Size, orderby, asc, &list, where) var datainfo DataInfo datainfo.Items = list datainfo.CurrentItemCount = total this.Data["json"] = &datainfo this.ServeJSON() } // @Title 文件上传 // @Description get user by tokenaddsubfile // @Success 200 {object} models.Userblood // @router /filelistappend [get] func (this *SupplierfileController) FileListAppend() { page := this.GetPageInfoForm() var list []supplierfile.OilSupplierFile svc := supplierfile.GetSupplierfileService(utils.DBE) where := " 1=1" orderby := "Id" asc := true Order := this.GetString("Order") Prop := this.GetString("Prop") if Order != "" && Prop != "" { orderby = Prop if Order == "asc" { asc = true } } SupplierId := this.GetString("SupplierId") if SupplierId != "" { where = where + " and SupplierId = '" + SupplierId + "'" } SupplierTypeCode := this.GetString("SupplierTypeCode") AppendId := this.GetString("AppendId") if SupplierTypeCode != "" { where = where + " and SupplierCertSubId= "+ AppendId +" and SupplierTypeCode in ( '000', '" + SupplierTypeCode + "')" } where = where + " and SupType != 1" total := svc.GetPagingEntitiesWithoutAccCode(page.CurrentPage, page.Size, orderby, asc, &list, where) var datainfo DataInfo datainfo.Items = list datainfo.CurrentItemCount = total this.Data["json"] = &datainfo this.ServeJSON() } // @Title 文件上传 // @Description get user by tokenaddsubfile // @Success 200 {object} models.Userblood // @router /filelist [get] func (this *SupplierfileController) FileList() { page := this.GetPageInfoForm() var list []supplierfile.OilSupplierFile svc := supplierfile.GetSupplierfileService(utils.DBE) where := " 1=1" orderby := "Id" asc := true Order := this.GetString("Order") Prop := this.GetString("Prop") if Order != "" && Prop != "" { orderby = Prop if Order == "asc" { asc = true } } SupplierId := this.GetString("SupplierId") if SupplierId != "" { where = where + " and SupplierId = '" + SupplierId + "'" } SupplierTypeCode := this.GetString("SupplierTypeCode") if SupplierTypeCode != "" { where = where + " and SupplierTypeCode in ( '000', '" + SupplierTypeCode + "')" } InStyle := this.GetString("InStyle") if InStyle != "4" { //paramSvc := baseparameter.GetBaseparameterService(utils.DBE) //var needFileType string //needFileType = paramSvc.GetBaseparameterMessage("GFGL", "paramset", "CooperationFile") where = where + " and NeedFileType not like '%战略%' " } where = where + " and SupType != 2" SubClassIds := this.GetString("SubClassIds") if SubClassIds!=""{ inWhere:="("+SubClassIds+")" sql:=" SupplierId="+SupplierId+" and SubClassId in "+inWhere var result []suppliercertsub.OilSupplierCert2File svc.GetEntities(&result,sql) str:="" if result!=nil{ for i:=0;i