fixed 修改服务层列表没使用await问题
This commit is contained in:
parent
4f17c322cd
commit
747ba75b8e
@ -62,28 +62,43 @@ namespace ARW.Model.Dto.Business.ShopManager.Shops
|
|||||||
/// @author 黎文豪
|
/// @author 黎文豪
|
||||||
/// @date 2023-06-09
|
/// @date 2023-06-09
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ShopQueryDto : PagerInfo
|
public class ShopQueryDto : PagerInfo
|
||||||
{
|
{
|
||||||
|
|
||||||
public string ShopName { get; set; }
|
public string ShopName { get; set; }
|
||||||
|
|
||||||
public int? ShopAuditStatus { get; set; }
|
public int? ShopAuditStatus { get; set; }
|
||||||
|
|
||||||
public string ids { get; set; }
|
public string ids { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// @author 黎文豪
|
/// @author 黎文豪
|
||||||
/// @date 2023-06-09
|
/// @date 2023-06-09
|
||||||
/// 审核对象
|
/// 审核对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ShopAuditDto
|
public class ShopAuditDto
|
||||||
{
|
{
|
||||||
public int ShopAuditStatus { get; set; }
|
public int ShopAuditStatus { get; set; }
|
||||||
public string ids { get; set; }
|
public string ids { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 店铺查询对象
|
||||||
|
///
|
||||||
|
/// @author 黎文豪
|
||||||
|
/// @date 2023-06-09
|
||||||
|
/// </summary>
|
||||||
|
public class CustomerWithOutBindQueryDto : PagerInfo
|
||||||
|
{
|
||||||
|
|
||||||
|
public string CustomerNickname { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -44,13 +44,13 @@ namespace ARW.Service.Business.BusinessService.Custom.CustomerAddresses
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询客户收货地址分页列表
|
/// 查询客户收货地址分页列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<PagedInfo<CustomerAddressVo>> GetCustomerAddressList(CustomerAddressQueryDto parm)
|
public async Task<PagedInfo<CustomerAddressVo>> GetCustomerAddressList(CustomerAddressQueryDto parm)
|
||||||
{
|
{
|
||||||
//开始拼装查询条件d
|
//开始拼装查询条件d
|
||||||
var predicate = Expressionable.Create<CustomerAddress>();
|
var predicate = Expressionable.Create<CustomerAddress>();
|
||||||
|
|
||||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.CustomerAddressName), it => it.CustomerAddressName.Contains(parm.CustomerAddressName));
|
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.CustomerAddressName), s => s.CustomerAddressName.Contains(parm.CustomerAddressName));
|
||||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.CustomerAddressPhone), it => it.CustomerAddressPhone.Contains(parm.CustomerAddressPhone));
|
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.CustomerAddressPhone), s => s.CustomerAddressPhone.Contains(parm.CustomerAddressPhone));
|
||||||
var query = _CustomerAddressRepository
|
var query = _CustomerAddressRepository
|
||||||
.Queryable()
|
.Queryable()
|
||||||
.LeftJoin<Customer>((s, c) => s.CustomerAddressCustomerGuid == c.CustomerGuid)
|
.LeftJoin<Customer>((s, c) => s.CustomerAddressCustomerGuid == c.CustomerGuid)
|
||||||
@ -75,7 +75,7 @@ namespace ARW.Service.Business.BusinessService.Custom.CustomerAddresses
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return query.ToPageAsync(parm);
|
return await query.ToPageAsync(parm);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -14,6 +14,9 @@ using ARW.Service.Business.IBusinessService.ShopManager.Shops;
|
|||||||
using ARW.Model.Dto.Business.ShopManager.Shops;
|
using ARW.Model.Dto.Business.ShopManager.Shops;
|
||||||
using ARW.Model.Models.Business.ShopManager.Shops;
|
using ARW.Model.Models.Business.ShopManager.Shops;
|
||||||
using ARW.Model.Vo.Business.ShopManager.Shops;
|
using ARW.Model.Vo.Business.ShopManager.Shops;
|
||||||
|
using MimeKit;
|
||||||
|
using ARW.Model.Models.Business.Custom.Customers;
|
||||||
|
using ARW.Repository.Business.Custom.Customers;
|
||||||
|
|
||||||
namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
||||||
{
|
{
|
||||||
@ -27,10 +30,13 @@ namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
|||||||
public class ShopServiceImpl : BaseService<Shop>, IShopService
|
public class ShopServiceImpl : BaseService<Shop>, IShopService
|
||||||
{
|
{
|
||||||
private readonly ShopRepository _ShopRepository;
|
private readonly ShopRepository _ShopRepository;
|
||||||
|
private readonly CustomerRepository _CustomerRepository;
|
||||||
|
|
||||||
public ShopServiceImpl(ShopRepository ShopRepository)
|
|
||||||
|
public ShopServiceImpl(ShopRepository ShopRepository, CustomerRepository customerRepository)
|
||||||
{
|
{
|
||||||
this._ShopRepository = ShopRepository;
|
this._ShopRepository = ShopRepository;
|
||||||
|
_CustomerRepository = customerRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 业务逻辑代码
|
#region 业务逻辑代码
|
||||||
@ -39,7 +45,7 @@ namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询店铺分页列表
|
/// 查询店铺分页列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<PagedInfo<ShopVo>> GetShopList(ShopQueryDto parm)
|
public async Task<PagedInfo<ShopVo>> GetShopList(ShopQueryDto parm)
|
||||||
{
|
{
|
||||||
//开始拼装查询条件d
|
//开始拼装查询条件d
|
||||||
var predicate = Expressionable.Create<Shop>();
|
var predicate = Expressionable.Create<Shop>();
|
||||||
@ -68,7 +74,7 @@ namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return query.ToPageAsync(parm);
|
return await query.ToPageAsync(parm);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -103,6 +109,35 @@ namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取未绑定的客户列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public async Task<PagedInfo<CustomerWithOutBindVo>> GetCustomerWithOutBindList(CustomerWithOutBindQueryDto parm)
|
||||||
|
{
|
||||||
|
//开始拼装查询条件d
|
||||||
|
var predicate = Expressionable.Create<Customer>();
|
||||||
|
|
||||||
|
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.CustomerNickname), s => s.CustomerNickname .Contains(parm.CustomerNickname));
|
||||||
|
|
||||||
|
var query = _CustomerRepository
|
||||||
|
.Queryable()
|
||||||
|
.Where(predicate.ToExpression())
|
||||||
|
.Where(s => SqlFunc.Subqueryable<Shop>().Where(it => it.ShopCustomerGuid == s.CustomerGuid).NotAny())
|
||||||
|
.OrderBy(s => s.Update_time, OrderByType.Desc)
|
||||||
|
.Select((s) => new CustomerWithOutBindVo
|
||||||
|
{
|
||||||
|
CustomerGuid = s.CustomerGuid,
|
||||||
|
CustomerNickname = s.CustomerNickname,
|
||||||
|
});
|
||||||
|
|
||||||
|
return await query.ToPageAsync(parm);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 审核
|
/// 审核
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -25,6 +25,14 @@ namespace ARW.Service.Business.IBusinessService.ShopManager.Shops
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<PagedInfo<ShopVo>> GetShopList(ShopQueryDto parm);
|
Task<PagedInfo<ShopVo>> GetShopList(ShopQueryDto parm);
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取未绑定的客户列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<PagedInfo<CustomerWithOutBindVo>> GetCustomerWithOutBindList(CustomerWithOutBindQueryDto parm);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加或修改店铺
|
/// 添加或修改店铺
|
||||||
|
@ -54,6 +54,18 @@ namespace ARW.WebApi.Controllers.Business.ShopManager.Shops
|
|||||||
return SUCCESS(res);
|
return SUCCESS(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取未绑定的客户列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm">查询参数</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("getCustomerWithOutBindList")]
|
||||||
|
public async Task<IActionResult> GetCustomerWithOutBindList([FromQuery] CustomerWithOutBindQueryDto parm)
|
||||||
|
{
|
||||||
|
var res = await _ShopService.GetCustomerWithOutBindList(parm);
|
||||||
|
return SUCCESS(res);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加或修改店铺
|
/// 添加或修改店铺
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -84,7 +84,7 @@ $end
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询${genTable.FunctionName}列表
|
/// 查询${genTable.FunctionName}列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<List<${replaceDto.ModelTypeName}Vo>> Get${replaceDto.ModelTypeName}List(${replaceDto.ModelTypeName}QueryDto parm)
|
public async Task<List<${replaceDto.ModelTypeName}Vo>> Get${replaceDto.ModelTypeName}List(${replaceDto.ModelTypeName}QueryDto parm)
|
||||||
{
|
{
|
||||||
//开始拼装查询条件d
|
//开始拼装查询条件d
|
||||||
var predicate = Expressionable.Create<${replaceDto.ModelTypeName}>();
|
var predicate = Expressionable.Create<${replaceDto.ModelTypeName}>();
|
||||||
@ -118,13 +118,13 @@ $end
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return query.ToListAsync();
|
return await query.ToListAsync();
|
||||||
}
|
}
|
||||||
$else
|
$else
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询${genTable.FunctionName}分页列表
|
/// 查询${genTable.FunctionName}分页列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<PagedInfo<${replaceDto.ModelTypeName}Vo>> Get${replaceDto.ModelTypeName}List(${replaceDto.ModelTypeName}QueryDto parm)
|
public async Task<PagedInfo<${replaceDto.ModelTypeName}Vo>> Get${replaceDto.ModelTypeName}List(${replaceDto.ModelTypeName}QueryDto parm)
|
||||||
{
|
{
|
||||||
//开始拼装查询条件d
|
//开始拼装查询条件d
|
||||||
var predicate = Expressionable.Create<${replaceDto.ModelTypeName}>();
|
var predicate = Expressionable.Create<${replaceDto.ModelTypeName}>();
|
||||||
@ -158,7 +158,7 @@ $end
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return query.ToPageAsync(parm);
|
return await query.ToPageAsync(parm);
|
||||||
}
|
}
|
||||||
$end
|
$end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user