报关单下拉绑定客户

master
wet 3 years ago
parent 0655a440c5
commit e7baaabadf

@ -16,12 +16,14 @@ namespace djy.Paas.Service
{ {
var rs=new ReturnPagedResult<ClientLinkInfoDto>(); var rs=new ReturnPagedResult<ClientLinkInfoDto>();
var sql = DbBus.Get(DbList.djyolddb).Select<InfoClientContact, OPSEAECLIENT>().LeftJoin((link, com) => link.LINKID == com.GID); //var sql = DbBus.Get(DbList.djyolddb).Select<InfoClientContact, OPSEAECLIENT>().LeftJoin((link, com) => link.LINKID == com.GID);
sql.WhereIf(Dto.CompGid.IsNotNull(), (link, com) => com.CompId == Dto.CompGid) //sql.WhereIf(Dto.CompGid.IsNotNull(), (link, com) => com.CompId == Dto.CompGid)
.WhereIf(Dto.ClientName.IsNotNull(), (link, com) => com.SHORTNAME.Contains(Dto.ClientName)) //.WhereIf(Dto.ClientName.IsNotNull(), (link, com) => com.SHORTNAME.Contains(Dto.ClientName))
.WhereIf(Dto.ClientCodeName.IsNotNull(), (link, com) => com.CODENAME.Contains(Dto.ClientCodeName)) //.WhereIf(Dto.ClientCodeName.IsNotNull(), (link, com) => com.CODENAME.Contains(Dto.ClientCodeName))
.WhereIf(Dto.LinkName.IsNotNull(), (link, com) => link.SHOWNAME.Contains(Dto.LinkName)); //.WhereIf(Dto.LinkName.IsNotNull(), (link, com) => link.SHOWNAME.Contains(Dto.LinkName));
rs.Data = sql.Count(out var totalcount).Page(apiFrom.Page, apiFrom.Limit).ToList<ClientLinkInfoDto>((info,com)=>new ClientLinkInfoDto {CompGid=com.CompId,ClientName=com.SHORTNAME,ClientCodeName=com.CODENAME, LinkName=info.SHOWNAME,Email=info.EMAIL }); //rs.Data = sql.Count(out var totalcount).Page(apiFrom.Page, apiFrom.Limit).ToList<ClientLinkInfoDto>((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<CompanyNew, UserBaseinfo>().LeftJoin((comp,user)=>comp.AdminUser==user.USERID);
rs.Data = sql.Count(out var totalcount).Page(apiFrom.Page, apiFrom.Limit).ToList<ClientLinkInfoDto>((comp, user) => new ClientLinkInfoDto { CompGid = comp.CompId, ClientName = comp.CompName, ClientCodeName = "", LinkName = comp.AdminShowName, Email = user.EMAIL1 });
rs.OK(); rs.OK();
return rs; return rs;
} }

@ -3,11 +3,14 @@ using Ys.Core.Common;
using djy.Model; using djy.Model;
using djy.Paas.Model; using djy.Paas.Model;
using djy.Paas.IService; using djy.Paas.IService;
using Microsoft.AspNetCore.Authorization;
namespace djyweb_djyPaasApi.Controllers namespace djyweb_djyPaasApi.Controllers
{ {
/// <summary> /// <summary>
/// 企业客户和联系人 /// 企业客户和联系人
/// </summary> /// </summary>
[AllowAnonymous]
public class ClientLinkController : ApiBase public class ClientLinkController : ApiBase
{ {
IClientLinkInfoService _client = IOC.AddServer<IClientLinkInfoService>(); IClientLinkInfoService _client = IOC.AddServer<IClientLinkInfoService>();
@ -21,7 +24,7 @@ namespace djyweb_djyPaasApi.Controllers
[HttpGet] [HttpGet]
public object GetList([FromQuery] ClientLinkInfoDto Dto, [FromQuery] ApiFromDto apiFrom) public object GetList([FromQuery] ClientLinkInfoDto Dto, [FromQuery] ApiFromDto apiFrom)
{ {
Dto.CompGid = GetUserInfo().CompId; //Dto.CompGid = GetUserInfo().CompId;
return _client.GetList(Dto, apiFrom); return _client.GetList(Dto, apiFrom);
} }

@ -174,7 +174,7 @@ namespace djyweb_djyPaasApi
//初始化数据字典 //初始化数据字典
var _itool = IOC.AddServer<IToolsService>(); var _itool = IOC.AddServer<IToolsService>();
//_itool.bindConfigDict(true, 5); _itool.bindConfigDict(true, 5);
_itool.AutoJob(); _itool.AutoJob();

Loading…
Cancel
Save