|
|
@@ -2047,4 +2047,98 @@ func (this *OilSupplierController) GetJurisdiction() {
|
|
|
datainfo.Item = isauth
|
|
|
this.Data["json"] = &datainfo
|
|
|
this.ServeJSON()
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取列表
|
|
|
+// @Description get user by token
|
|
|
+// @Success 200 {object} []supplier.OilSupplier
|
|
|
+// @router /certlistinterface [get]
|
|
|
+func (this *OilSupplierController) GetEntityListInterface () {
|
|
|
+
|
|
|
+ //获取分页信息
|
|
|
+ page := this.GetPageInfoForm()
|
|
|
+ where := " 1=1 "
|
|
|
+ orderby := "Id"
|
|
|
+ asc := false
|
|
|
+ Order := this.GetString("Order")
|
|
|
+ Prop := this.GetString("Prop")
|
|
|
+ if Order != "" && Prop != "" {
|
|
|
+ orderby = Prop
|
|
|
+ if Order == "asc" {
|
|
|
+ asc = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ status := this.GetString("status")
|
|
|
+
|
|
|
+ if status == "1" {
|
|
|
+ where += "b.InStyle='1'"
|
|
|
+ } else if status == "2" {
|
|
|
+ where += "b.InStyle='4'"
|
|
|
+ } else if status == "3" {
|
|
|
+ where += "b.InStyle='5'"
|
|
|
+ } else if status == "4" {
|
|
|
+ where += "b.InStyle=''"
|
|
|
+ } else if status == "5" {
|
|
|
+ where += "b.InStyle=''"
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //企业用户只看自己的数据记录
|
|
|
+ /*parameterSvc := baseparameter.GetBaseparameterService(utils.DBE) //取出外部门ID
|
|
|
+ extOrganizeId := parameterSvc.GetBaseparameterMessage("GFGL", "paramset", "ExtOrganizeId")
|
|
|
+ if extOrganizeId == this.User.DepartmentId {
|
|
|
+ where = where + " and a.CreateUserId = '" + this.User.Id + "'"
|
|
|
+ }*/
|
|
|
+ svc := supplier.GetOilSupplierService(utils.DBE)
|
|
|
+ var registerUser register.OilCorporateInfo
|
|
|
+ sql := " UserName='" + this.User.Username + "'"
|
|
|
+ svc.GetEntity(®isterUser,sql)
|
|
|
+ //企业用户必须加创建人条件
|
|
|
+ if this.User.IsCompanyUser == 1 {
|
|
|
+ where = where + " and (a.CreateUserId = '" + this.User.Id + "' or a.CommercialNo='"+registerUser.CommercialNo+"')"
|
|
|
+ } else {
|
|
|
+ //超级管理员和有查看所有数据权限的用户不加条件
|
|
|
+ svcPerm := permission.GetPermissionService(utils.DBE)
|
|
|
+ isauth := svcPerm.IsAuthorized(this.User.Id, "oil_supplier.marketAccess.AllRecord")
|
|
|
+ if !svcPerm.IsAdmin(this.User.Id) && !isauth {
|
|
|
+ where = where + " and b.CreateUserId = '" + this.User.Id + "'"
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ var list []supplier.OilSupplierView
|
|
|
+
|
|
|
+ total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
+
|
|
|
+ var datainfo DataInfo
|
|
|
+ datainfo.Items = list
|
|
|
+ datainfo.CurrentItemCount = total
|
|
|
+ datainfo.PageIndex = page.CurrentPage
|
|
|
+ datainfo.ItemsPerPage = page.Size
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|