|
|
|
@ -31,19 +31,37 @@ public class SwapOrderService : BaseServices<SwapOrder>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Dictionary<string, int?> QueryReportCloudNumBySn(List<string> swapOrderSns)
|
|
|
|
|
{
|
|
|
|
|
if (swapOrderSns.Count <= 0)
|
|
|
|
|
{
|
|
|
|
|
return new Dictionary<string, int?>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<SwapOrderReportCloud> swapOrderReportClouds =
|
|
|
|
|
SwapOrderReportCloudRepository.QueryListByClause(i => swapOrderSns.Contains(i.SwapOrderSn));
|
|
|
|
|
|
|
|
|
|
if (swapOrderReportClouds.Count <= 0)
|
|
|
|
|
{
|
|
|
|
|
return new Dictionary<string, int?>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return swapOrderReportClouds.ToDictionary(i => i.SwapOrderSn, i => i.CloudReportStatus++);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Result<bool> UploadCloud(int id)
|
|
|
|
|
{
|
|
|
|
|
List<SwapOrderReportCloud> list =
|
|
|
|
|
SwapOrderReportCloudRepository.QueryListByClause(i => i.CloudReportStatus == 0 && i.SwapOrderId == id);
|
|
|
|
|
SwapOrderReportCloudRepository.QueryListByClause(i => i.CloudReportStatus < 100 && i.SwapOrderId == id);
|
|
|
|
|
|
|
|
|
|
if (list.Count <= 0)
|
|
|
|
|
{
|
|
|
|
|
return Result<bool>.Fail("当前换电订单不满足上报云平台的条件");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return SwapOrderMgr.UploadCloud(list, 2) ? Result<bool>.Success() : Result<bool>.Fail();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询需要导出换电订单
|
|
|
|
|
/// </summary>
|
|
|
|
@ -55,12 +73,15 @@ public class SwapOrderService : BaseServices<SwapOrder>
|
|
|
|
|
ParameterExpression parameter = Expression.Parameter(typeof(SwapOrder), "u");
|
|
|
|
|
|
|
|
|
|
#region 构建动态查询树
|
|
|
|
|
|
|
|
|
|
where = queryTree(swapOrder, where, parameter);
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
// 查询需要导出充电订单 不分页
|
|
|
|
|
return await swapOrderRepository.QuerySwapOrderList(where);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据条件查询分页数据
|
|
|
|
|
/// </summary>
|
|
|
|
@ -92,7 +113,8 @@ public class SwapOrderService : BaseServices<SwapOrder>
|
|
|
|
|
return PageResult<SwapOrderResp>.ConvertPage(swapOrderRepository.QueryIPage(swapOrder, where));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static Expression<Func<SwapOrder, bool>>? queryTree(QuerySwapOrderPageReq swapOrder, Expression<Func<SwapOrder, bool>>? where, ParameterExpression parameter)
|
|
|
|
|
private static Expression<Func<SwapOrder, bool>>? queryTree(QuerySwapOrderPageReq swapOrder,
|
|
|
|
|
Expression<Func<SwapOrder, bool>>? where, ParameterExpression parameter)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(swapOrder.Sn))
|
|
|
|
|
{
|
|
|
|
|