Browse Source

分页接口

Liuqi 6 years ago
parent
commit
12525e5b75
1 changed files with 51 additions and 1 deletions
  1. 51 1
      src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

+ 51 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

@@ -246,7 +246,7 @@ func (this *SelectController) GetTList() {
 
 }
 
-// @Title 获取所有
+// @Title 根据公司名获取公司信息和准入
 // @Description
 // @Success 200 {object}
 // @router /getbaseinfo [post]
@@ -274,6 +274,15 @@ func (this *SelectController) GetBaseInfo() {
 			where = "where SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode='03'"
 			svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.JFsub)
 
+		}else if item == "" {
+			where = "where SupplierTypeCode='01'"
+			svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.WZsub)
+
+			where = "where and SupplierTypeCode='02'"
+			svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.JSsub)
+
+			where = "where SupplierTypeCode='03'"
+			svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.JFsub)
 		}
 		infoIntelist = append(infoIntelist, infoInte)
 	}
@@ -286,6 +295,47 @@ func (this *SelectController) GetBaseInfo() {
 
 }
 
+// @Title 根据分页获取公司信息和准入
+// @Description
+// @Success 200 {object}
+// @router /getinfobypage [post]
+func (this *SelectController) GetInfoByPage() {
+	page := this.GetString("page")
+
+	svc := selectbusiness.GetSelectService(utils.DBE)
+	var infoIntelist []supplier.OilSupplierInte
+	intpage, _ := strconv.Atoi(page)
+
+	for i:= (intpage-1)*50;i < (intpage*50) ;i++{
+		//var supplierinfo supplier.SupplierInfoInte
+		var infoInte supplier.OilSupplierInte
+		stringi := strconv.Itoa(i)
+		where := " where 1 = 1 limit "+ stringi + ",1"
+		svc.GetInfoByCompId(where,&infoInte.SupplierInfo)
+		if infoInte.SupplierInfo.SupplierName != "" {
+
+			where = "where SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode='01'"
+			svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.WZsub)
+
+			where = "where SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode='02'"
+			svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.JSsub)
+
+			where = "where SupplierId=" + strconv.Itoa(infoInte.SupplierInfo.Id) + " and SupplierTypeCode='03'"
+			svc.Getoilsuppliercertsub(OilSupplierCertSubName, where, &infoInte.JFsub)
+		}
+		if infoInte.SupplierInfo.Id != 0 {
+			infoIntelist = append(infoIntelist, infoInte)
+		}
+	}
+
+	var datainfo DataInfo
+	datainfo.Items = infoIntelist
+
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+
+}
+
 // @Title 获取所有
 // @Description
 // @Success 200 {object}