Commit faaf7596 authored by 吴春's avatar 吴春

1

parent 3f72988d
......@@ -189,21 +189,25 @@ namespace REBORN.Common.Plugin
/// <summary>
/// 格式化日期
/// </summary>
/// <param name="date"></param>
/// <returns></returns>
/// <param name="date">日期对象</param>
/// <returns>格式化后的日期字符串,如果日期无效或为默认值则返回空字符串</returns>
public static string FormatDate(object date)
{
try
{
if (date != null)
if (date != null && DateTime.TryParse(date.ToString(), out DateTime dt))
{
DateTime.TryParse(date.ToString(), out DateTime dt);
// 检查是否为 DateTime 默认值 (0001-01-01)
if (dt == DateTime.MinValue || dt.ToString("yyyy-MM-dd") == "0001-01-01")
{
return "";
}
return dt.ToString("yyyy-MM-dd");
}
}
catch
{
}
return "";
}
......
......@@ -2764,7 +2764,7 @@ TEL:03-3779-9111";
{ nameof(RB_Sell_VisaOrder.FinalPriceTips),model.FinalPriceTips},
{ nameof(RB_Sell_VisaOrder.SupplierId),model.SupplierId},
{ nameof(RB_Sell_VisaOrder.VisaId),model.VisaId},
};
IList<WhereHelper> whereHelpers = new List<WhereHelper>()
{
......@@ -3688,6 +3688,15 @@ TEL:03-3779-9111";
public List<RB_Sell_VisaOrder_Extend> GetOrderVisaOrderList(int pageIndex, int pageSize, RB_Sell_VisaOrder_Extend model, UserInfo userInfo, out long count, bool IsAdmin = false)
{
if (userInfo != null && userInfo.RB_Post_Id > 0)
{
string actionMenu = CacheManager.User.RbUserCache.GetUserActionMenu(userInfo.RB_Post_Id);
if (!string.IsNullOrEmpty(actionMenu) && actionMenu.Contains("S_CheckAllOrder"))//查看全部的订单信息
{
IsAdmin = false;
model.CreateBy = 0;
}
}
var list = sell_VisaOrderRepository.GetOrderVisaOrderList(pageIndex, pageSize, model, out count, userInfo: IsAdmin ? userInfo : null);
List<int> OrderIntL = list.Select(x => x.Id).ToList();
List<int> VisaPlanL = list.Select(x => (x.VisaPlanId ?? 0)).Distinct().Where(x => x > 0).ToList();
......
......@@ -1305,6 +1305,16 @@ namespace REBORN.Module.SellModule
/// <returns></returns>
public List<RB_Customer_HotelOrder_Extend> GetMyCustomerOrderPageList(int pageIndex, int pageSize, out long count, RB_Customer_HotelOrder_Extend query, bool IsAdmin = false, UserInfo userInfo = null, bool frSelect = false)
{
if (userInfo != null && userInfo.RB_Post_Id > 0)
{
string actionMenu = CacheManager.User.RbUserCache.GetUserActionMenu(userInfo.RB_Post_Id);
if (!string.IsNullOrEmpty(actionMenu) && actionMenu.Contains("S_CheckAllOrder"))//查看全部的订单信息
{
IsAdmin = false;
query.EnterID = 0;
}
}
var list = hotelOrderRepository.GetMyCustomerOrderPageList(pageIndex, pageSize, out count, query, (IsAdmin ? userInfo : null));
if (list.Any())
{
......@@ -3616,6 +3626,15 @@ namespace REBORN.Module.SellModule
/// <returns></returns>
public List<RB_Customer_TicketOrder_Extend> GetTicketOrderPageList(int pageIndex, int pageSize, out long count, RB_Customer_TicketOrder_Extend query, bool frSelect, bool IsAdmin = false, UserInfo userInfo = null)
{
if (userInfo != null && userInfo.RB_Post_Id > 0)
{
string actionMenu = CacheManager.User.RbUserCache.GetUserActionMenu(userInfo.RB_Post_Id);
if (!string.IsNullOrEmpty(actionMenu) && actionMenu.Contains("S_CheckAllOrder"))//查看全部的订单信息
{
IsAdmin = false;
query.EnterID = 0;
}
}
var list = customer_TicketOrderRepository.GetTicketOrderPageList(pageIndex, pageSize, out count, query, (IsAdmin ? userInfo : null));
if (list.Any())
{
......
......@@ -6759,7 +6759,7 @@ namespace REBORN.Module.SellModule
coupon_AllotRepository.DBSession.Commit();
//自动更新候补订单
updaeTravelOrderWaitingRepository.UpdateOrderWaitingRepository(tmodel, null);
if (isAddorder&& userInfo.SimpleEasy == 0)
if (isAddorder && userInfo.SimpleEasy == 0)
{
//推送消息到企业微信
//新增订单,推送消息
......@@ -14702,9 +14702,17 @@ namespace REBORN.Module.SellModule
/// <param name="isGetCouponAllotInfo">是否查询优惠券信息(true查询,false不查询)</param>
/// <param name="isNormal"></param>
/// <returns></returns>
public List<RB_Travel_Order_Extend> GetTravelOrderList_V2(int pageIndex, int pageSize, RB_Travel_Order_Extend model, out long count, string lineIdStr = "", bool isGetLeader = true, bool isGetCouponAllotInfo = false, int isNormal = 0, UserInfo userInfo = null)
public List<RB_Travel_Order_Extend> GetTravelOrderList_V2(int pageIndex, int pageSize, RB_Travel_Order_Extend model, out long count, string lineIdStr = "", bool isGetLeader = true, bool isGetCouponAllotInfo = false, int isNormal = 0, UserInfo userInfo = null, int isMyOrder = 0)
{
var list = orderRepository.GetTravelOrderList_V2(pageIndex, pageSize, model, out count, lineIdStr, isGetLeader, userInfo: userInfo);
if (userInfo != null && userInfo.RB_Post_Id > 0 && isMyOrder == 0)
{
string actionMenu = CacheManager.User.RbUserCache.GetUserActionMenu(userInfo.RB_Post_Id);
if (!string.IsNullOrEmpty(actionMenu) && actionMenu.Contains("S_CheckAllOrder"))//查看全部的订单信息
{
model.CreateBy = 0;
}
}
var list = orderRepository.GetTravelOrderList_V2(pageIndex, pageSize, model, out count, lineIdStr, isGetLeader, userInfo: isMyOrder == 0 ? userInfo : null);
List<int> OrderIntL = list.Select(x => x.OrderId).ToList();
if (OrderIntL.Count > 0)
{
......@@ -16811,9 +16819,17 @@ namespace REBORN.Module.SellModule
/// <param name="isGetLeader">是否查询领队(true查询,false不查询)</param>
/// <param name="isGetSetNum">是否机位(true查询,false不查询)</param>
/// <returns></returns>
public RB_Travel_Order_Extend GetTravelOrderListStatistics_V2(RB_Travel_Order_Extend model, UserInfo userInfo = null, string lineIdStr = "", bool isGetLeader = true, bool isGetSetNum = false)
public RB_Travel_Order_Extend GetTravelOrderListStatistics_V2(RB_Travel_Order_Extend model, UserInfo userInfo = null, int isMyOrder = 0, string lineIdStr = "", bool isGetLeader = true, bool isGetSetNum = false)
{
var smodel = orderRepository.GetTravelOrderListStatistics_V2(model, userInfo, lineIdStr, isGetLeader);
if (userInfo != null && userInfo.RB_Post_Id > 0 && isMyOrder == 0)
{
string actionMenu = CacheManager.User.RbUserCache.GetUserActionMenu(userInfo.RB_Post_Id);
if (!string.IsNullOrEmpty(actionMenu) && actionMenu.Contains("S_CheckAllOrder"))//查看全部的订单信息
{
model.CreateBy = 0;
}
}
var smodel = orderRepository.GetTravelOrderListStatistics_V2(model, userInfo: isMyOrder == 0 ? userInfo : null, lineIdStr, isGetLeader);
//var orderlist = orderRepository.GetTravelOrderListStatisticsTwo_V2(model, lineIdStr, isGetLeader);
// HK 2019-05-14新增机位统计
if (isGetSetNum)
......@@ -553,7 +553,11 @@ GROUP BY ogh.OrderId
}
if (model.CreateBy > 0)
{
where += $@" AND (A.{nameof(RB_Travel_Order.EnterID)}={(int)model.CreateBy} or A.{nameof(RB_Travel_Order.CommissionSharePeople)}={(int)model.CreateBy} {((userInfo?.SimpleEasy ?? 0) == 1 ? "or aop.OPId="+ (int)model.CreateBy : " ")} )";
where += $@" AND (A.{nameof(RB_Travel_Order.EnterID)}={(int)model.CreateBy} or A.{nameof(RB_Travel_Order.CommissionSharePeople)}={(int)model.CreateBy} )";
}
if ((userInfo?.SimpleEasy ?? 0) == 1)
{
where += $" and aop.OPId=" + userInfo.EmployeeId;
}
if (model.BranchId >= 0)
{
......@@ -1590,7 +1594,11 @@ left join rb_lineteam E on E.LtID=C.LineteamId
}
if (model.CreateBy > 0)
{
where += $@" AND (A.{nameof(RB_Travel_Order.EnterID)}={(int)model.CreateBy} or A.{nameof(RB_Travel_Order.CommissionSharePeople)}={(int)model.CreateBy} {((userInfo?.SimpleEasy ?? 0) == 1 ? "or aop.OPId=" + (int)model.CreateBy : " ")} )";
where += $@" AND (A.{nameof(RB_Travel_Order.EnterID)}={(int)model.CreateBy} or A.{nameof(RB_Travel_Order.CommissionSharePeople)}={(int)model.CreateBy})";
}
if ((userInfo?.SimpleEasy ?? 0) == 1)
{
where += $" and aop.OPId=" + userInfo.EmployeeId;
}
if (model.BranchId >= 0)
{
......@@ -1668,8 +1676,8 @@ SUM(CASE WHEN IFNULL(A.CommissionSharePeople,0)!={(int)model.CreateBy} AND A.Ord
,SUM(CASE WHEN IFNULL(A.CommissionSharePeople,0)!={(int)model.CreateBy} AND A.OrderState!={(int)SellOrderStatusEnum.Cancel} THEN IFNULL(A.RedEnvelopeMoney,0) ELSE 0 END) AS RedEnvelopeMoney
,SUM(CASE WHEN IFNULL(A.CommissionSharePeople,0)!={(int)model.CreateBy} AND A.OrderState!={(int)SellOrderStatusEnum.Cancel} THEN (IFNULL(A.PreferPrice,0)-IFNULL(A.Income,0)+IFNULL(A.Refund,0)-IFNULL(A.PlatformTax,0)-IFNULL(A.DiscountMoney,0)-IFNULL(A.RedEnvelopeMoney,0)) ELSE 0 END) AS DueinMoney
,SUM(CASE WHEN IFNULL(A.CommissionSharePeople,0)!={(int)model.CreateBy} AND A.OrderSource={(int)OrderSourceEnum.Internal} THEN 1 ELSE 0 END) AS InteriorNum
,SUM(CASE WHEN IFNULL(A.CommissionSharePeople,0)!={(int)model.CreateBy} AND A.OrderSource in ({(int)OrderSourceEnum.B2B},{(int)OrderSourceEnum.WAP}) THEN 1 ELSE 0 END) AS B2BNum from
{((userInfo?.SimpleEasy ?? 0) == 1 ? "( SELECT A.* " : "")}
,SUM(CASE WHEN IFNULL(A.CommissionSharePeople,0)!={(int)model.CreateBy} AND A.OrderSource in ({(int)OrderSourceEnum.B2B},{(int)OrderSourceEnum.WAP}) THEN 1 ELSE 0 END) AS B2BNum
{((userInfo?.SimpleEasy ?? 0) == 1 ? " from ( SELECT A.* " : "")}
from rb_travel_order AS A
LEFT JOIN rb_travel_price as B ON A.TCID=B.TCID
LEFT JOIN rb_travel_config AS C ON c.ID=B.ConfigID
......
......@@ -3942,7 +3942,8 @@ namespace REBORN.Services.SellService
// return ApiResult.ParamIsNull("只有散拼参团");
//}
#region 验证促销团无法使用幸福存折
if (TModel != null && TModel.TCSaleState == TCSaleStateEnum.Promotion) {
if (TModel != null && TModel.TCSaleState == TCSaleStateEnum.Promotion)
{
return ApiResult.Failed("此团为特价团,无法使用幸福存折抵扣,请联系销售核实后再试!");
}
#endregion
......@@ -10793,11 +10794,26 @@ namespace REBORN.Services.SellService
//HK 2024-01-23 新加 麦子助手过来,查询所有订单
OrderInfo.IsOneDay = -1;
}
OrderInfo.CreateBy = userInfo.EmployeeId;
OrderInfo.Sort = 2;
OrderInfo.RB_Group_Id = userInfo.RB_Group_id;
OrderInfo.OutBranchId = -1;
var list = sellOrderModule.GetTravelOrderList_V2(pmodel.pageIndex, pmodel.pageSize, OrderInfo, out long count, "", true, true, userInfo: userInfo);
string isMyOrderStr = parm.GetStringValue("IsMyOrder");
int isMyOrder = 1;
if (!string.IsNullOrWhiteSpace(isMyOrderStr))
{
isMyOrder = parm.GetInt("IsMyOrder", 1);
if (isMyOrder == 1)//自己的订单
{
OrderInfo.CreateBy = userInfo.EmployeeId;
}
}
else
{
OrderInfo.CreateBy = userInfo.EmployeeId;
}
var list = sellOrderModule.GetTravelOrderList_V2(pmodel.pageIndex, pmodel.pageSize, OrderInfo, out long count, "", true, true, userInfo: userInfo, isMyOrder: isMyOrder);
var data = list.Select(x => new
{
x.OrderspecialofferState,
......@@ -11132,12 +11148,27 @@ namespace REBORN.Services.SellService
/// <returns></returns>
public virtual ApiResult GetTravelOrderListStatistics_V2(RequestParm request)
{
JObject parm = JObject.Parse(request.msg.ToString());
UserInfo userInfo = CacheManager.User.RbUserCache.GetUserLoginInfo(request.uid);
RB_Travel_Order_Extend OrderInfo = JsonConvert.DeserializeObject<RB_Travel_Order_Extend>(request.msg.ToString());
OrderInfo.CreateBy = userInfo.EmployeeId;
OrderInfo.RB_Group_Id = userInfo.RB_Group_id;
OrderInfo.OutBranchId = -1;
var model = sellOrderModule.GetTravelOrderListStatistics_V2(OrderInfo, userInfo)??new RB_Travel_Order_Extend();
string isMyOrderStr = parm.GetStringValue("IsMyOrder");
int isMyOrder = 1;
if (!string.IsNullOrWhiteSpace(isMyOrderStr))
{
isMyOrder = parm.GetInt("IsMyOrder", 1);
if (isMyOrder == 1)//自己的订单
{
OrderInfo.CreateBy = userInfo.EmployeeId;
}
}
else
{
OrderInfo.CreateBy = userInfo.EmployeeId;
}
var model = sellOrderModule.GetTravelOrderListStatistics_V2(OrderInfo, userInfo, isMyOrder: isMyOrder) ?? new RB_Travel_Order_Extend();
return ApiResult.Success("", new
{
model.TotalESeatNum,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment