diff --git a/djy.paas.Service/ClientLinkInfoService.cs b/djy.paas.Service/ClientLinkInfoService.cs index 9d61780..81fda3a 100644 --- a/djy.paas.Service/ClientLinkInfoService.cs +++ b/djy.paas.Service/ClientLinkInfoService.cs @@ -16,12 +16,14 @@ namespace djy.Paas.Service { var rs=new ReturnPagedResult(); - var sql = DbBus.Get(DbList.djyolddb).Select().LeftJoin((link, com) => link.LINKID == com.GID); - sql.WhereIf(Dto.CompGid.IsNotNull(), (link, com) => com.CompId == Dto.CompGid) - .WhereIf(Dto.ClientName.IsNotNull(), (link, com) => com.SHORTNAME.Contains(Dto.ClientName)) - .WhereIf(Dto.ClientCodeName.IsNotNull(), (link, com) => com.CODENAME.Contains(Dto.ClientCodeName)) - .WhereIf(Dto.LinkName.IsNotNull(), (link, com) => link.SHOWNAME.Contains(Dto.LinkName)); - rs.Data = sql.Count(out var totalcount).Page(apiFrom.Page, apiFrom.Limit).ToList((info,com)=>new ClientLinkInfoDto {CompGid=com.CompId,ClientName=com.SHORTNAME,ClientCodeName=com.CODENAME, LinkName=info.SHOWNAME,Email=info.EMAIL }); + //var sql = DbBus.Get(DbList.djyolddb).Select().LeftJoin((link, com) => link.LINKID == com.GID); + //sql.WhereIf(Dto.CompGid.IsNotNull(), (link, com) => com.CompId == Dto.CompGid) + //.WhereIf(Dto.ClientName.IsNotNull(), (link, com) => com.SHORTNAME.Contains(Dto.ClientName)) + //.WhereIf(Dto.ClientCodeName.IsNotNull(), (link, com) => com.CODENAME.Contains(Dto.ClientCodeName)) + //.WhereIf(Dto.LinkName.IsNotNull(), (link, com) => link.SHOWNAME.Contains(Dto.LinkName)); + //rs.Data = sql.Count(out var totalcount).Page(apiFrom.Page, apiFrom.Limit).ToList((info,com)=>new ClientLinkInfoDto {CompGid=com.CompId,ClientName=com.SHORTNAME,ClientCodeName=com.CODENAME, LinkName=info.SHOWNAME,Email=info.EMAIL }); + var sql = DbBus.Get(DbList.djyolddb).Select().LeftJoin((comp,user)=>comp.AdminUser==user.USERID); + rs.Data = sql.Count(out var totalcount).Page(apiFrom.Page, apiFrom.Limit).ToList((comp, user) => new ClientLinkInfoDto { CompGid = comp.CompId, ClientName = comp.CompName, ClientCodeName = "", LinkName = comp.AdminShowName, Email = user.EMAIL1 }); rs.OK(); return rs; } diff --git a/djyweb_djyPaasApi/Controllers/ClientLinkController.cs b/djyweb_djyPaasApi/Controllers/ClientLinkController.cs index 4055e15..2c97679 100644 --- a/djyweb_djyPaasApi/Controllers/ClientLinkController.cs +++ b/djyweb_djyPaasApi/Controllers/ClientLinkController.cs @@ -3,11 +3,14 @@ using Ys.Core.Common; using djy.Model; using djy.Paas.Model; using djy.Paas.IService; +using Microsoft.AspNetCore.Authorization; + namespace djyweb_djyPaasApi.Controllers { /// /// 企业客户和联系人 /// + [AllowAnonymous] public class ClientLinkController : ApiBase { IClientLinkInfoService _client = IOC.AddServer(); @@ -21,7 +24,7 @@ namespace djyweb_djyPaasApi.Controllers [HttpGet] public object GetList([FromQuery] ClientLinkInfoDto Dto, [FromQuery] ApiFromDto apiFrom) { - Dto.CompGid = GetUserInfo().CompId; + //Dto.CompGid = GetUserInfo().CompId; return _client.GetList(Dto, apiFrom); } diff --git a/djyweb_djyPaasApi/Startup.cs b/djyweb_djyPaasApi/Startup.cs index 1696d8c..4be713d 100644 --- a/djyweb_djyPaasApi/Startup.cs +++ b/djyweb_djyPaasApi/Startup.cs @@ -174,7 +174,7 @@ namespace djyweb_djyPaasApi //ʼֵ var _itool = IOC.AddServer(); - //_itool.bindConfigDict(true, 5); + _itool.bindConfigDict(true, 5); _itool.AutoJob();