using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using djy.Paas.IService;
using djy.Paas.Model;
using Ys.Core.Common;
namespace djy.Paas.Service
{
///
/// 报关货主端实现接口接口实现
///
public class BaoguanOrderClientService:ServBase,IBaoguanOrderClientService
{
public BaoguanOrderClientService(string dbkey = DbList.djypublicedb) : base(dbkey) { }
///
///
///
///
///
///
public ReturnPagedResult GetList(BaoguanOrderClientDto Dto, ApiFromDto apiFromDto)
{
var rs =new ReturnPagedResult();
var sql = DbBus.Get(DbList.djypublicedb).Select().LeftJoin((c, o) => c.BaoguanOrderGid == o.Gid).Where((c, o) => c.Status > 0)
.WhereIf(Dto.CompGId != null, (c, o) => c.CompGId == Dto.CompGId)
.WhereIf(Dto.UserGid != null, (c, o) => c.UserGid == Dto.UserGid)
.WhereIf(Dto.Gidlist.Count>0,(c,o)=>Dto.Gidlist.Contains(c.Gid))
.WhereIf(Dto.ShipOrderNo.IsNotNull(),(c,o)=>c.ShipOrderNo==Dto.ShipOrderNo)
.WhereIf(Dto.ShipOrderNo.IsNotNull(), (c, o) => c.ShipOrderNo.Contains(Dto.ShipOrderNo))
.WhereIf(Dto.BaoguanAgent.IsNotNull(), (c, o) => c.BaoguanAgent.Contains(Dto.BaoguanAgent))
.WhereIf(Dto.IEFlag.IsNotNull(), (c, o) => c.IEFlag == Dto.IEFlag);
rs.Data = sql.OrderByDescending((c, o) => c.AddTime).Count(out var totalcount).Page(apiFromDto.Page,apiFromDto.Limit)
.ToList();
rs.Pageset(apiFromDto,totalcount);
rs.OK();
return rs;
}
///
/// 创建客户报关单同时数据初始化到阿里报关数据回写做绑定关系
///
///
///
public new ReturnResult