Commit cd57ca70 authored by liudong1993's avatar liudong1993

1

parent 02861d95
......@@ -90,6 +90,10 @@
<Project>{cfbabc88-b4e9-4f5d-8950-7bec12af7ba5}</Project>
<Name>REBORN.Module.DataStatisticsModule</Name>
</ProjectReference>
<ProjectReference Include="..\REBORN.Module.FinanceModule\REBORN.Module.FinanceModule.csproj">
<Project>{1658175f-4a31-48b6-b0fe-494f609cff2a}</Project>
<Name>REBORN.Module.FinanceModule</Name>
</ProjectReference>
<ProjectReference Include="..\REBORN.Repository\REBORN.Repository.csproj">
<Project>{DE668CE6-7AD2-4960-96DE-2C2653723180}</Project>
<Name>REBORN.Repository</Name>
......
......@@ -146,7 +146,7 @@ namespace REBORN.Repository.Dmc
}
if (!string.IsNullOrEmpty(demodel.ContactName))
{
where += $" and o.{nameof(RB_Customer_HotelOrder_Extend.ContactName)} like @ContactName";
where += $" and (o.{nameof(RB_Customer_HotelOrder_Extend.ContactName)} like @ContactName or g.Name like @ContactName) ";
parameters.Add("ContactName", "%" + demodel.ContactName + "%");
}
if (!string.IsNullOrEmpty(demodel.ContactNumber))
......@@ -195,6 +195,7 @@ namespace REBORN.Repository.Dmc
left join rb_customer_hotelorderdetail d on o.OrderId = d.OrderId
left join rb_customer_hotelorderroom r on d.Id = r.DetailId
{((userInfo?.SimpleEasy ?? 0) == 1 ? " left JOIN rb_appoint_op aop on aop.OrderId=o.OrderId and aop.ResourceType=" + (int)Common.Enum.ResourceTypeEnum.Hotel : "")}
{(!string.IsNullOrEmpty(demodel.ContactName) ? " left join rb_travel_guest g on o.OrderId=g.OrderId and g.IsAllograph=3 and g.Status=0" : "")}
where {where} group by o.OrderId order by o.OrderId desc";
return GetPage<RB_Customer_HotelOrder_Extend>(pageIndex, pageSize, out count, sql, parameters).ToList();
}
......
......@@ -317,6 +317,10 @@ left join {nameof(RB_Visa_Management)} m on A.{nameof(RB_Sell_VisaProduct.VisaMa
{
where += $@" AND B.{nameof(RB_Sell_VisaProduct.Name)} like '%{model.Name}%'";
}
if (!string.IsNullOrWhiteSpace(model.ContactName))
{
where += $@" AND g.Name like '%{model.ContactName}%'";
}
if (model.OpEmpId > 0)
{
where += $@" AND case when A.{nameof(RB_Sell_VisaOrder.FinishEmpId)} >0 then A.{nameof(RB_Sell_VisaOrder.FinishEmpId)} ={model.OpEmpId} else B.{nameof(RB_Sell_VisaProduct.CreateBy)} ={model.OpEmpId} end";
......@@ -395,6 +399,7 @@ left join {nameof(RB_Visa_Management)} m on A.{nameof(RB_Sell_VisaProduct.VisaMa
string sql = $@" select A.*,B.Name,B.SendVisaDate as SendStartDate,B.CoverImage,B.RB_Branch_Id as OutBranchId,B.VisaManagementId,case when A.FinishEmpId >0 then A.FinishEmpId else B.CreateBy end as OpEmpId from {TableName} as A
left join {TableNameProduct} as B on A.VisaId=B.Id
{((userInfo?.SimpleEasy ?? 0) == 1 ? (" left JOIN rb_appoint_op aop on aop.OrderId=a.Id and aop.ResourceType=" + (int)Common.Enum.ResourceTypeEnum.Visa) : "")}
{(!string.IsNullOrEmpty(model.ContactName) ? " left join rb_travel_guest g on a.Id=g.OrderId and g.IsAllograph=1 and g.Status=0" : "")}
{where} GROUP BY a.Id order by A.{nameof(RB_Sell_VisaOrder.CreateTime)} desc";
return GetPage<RB_Sell_VisaOrder_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
......
......@@ -536,7 +536,7 @@ GROUP BY ogh.OrderId
//}
if (!string.IsNullOrWhiteSpace(model.ContactName))
{
where += $@" AND A.{nameof(RB_Travel_Order.ContactName)} like '%{model.ContactName}%'";
where += $@" AND (A.{nameof(RB_Travel_Order.ContactName)} like '%{model.ContactName}%' or g.Name like '%{model.ContactName}%')";
}
if (!string.IsNullOrWhiteSpace(model.Title))
{
......@@ -719,7 +719,8 @@ LEFT JOIN rb_travel_config AS C ON c.ID=B.ConfigID
left join rb_line D on D.LineID=C.LineId
left join rb_lineteam E on E.LtID=C.LineteamId
{((userInfo?.SimpleEasy ?? 0)==1? " left JOIN rb_appoint_op aop on aop.OrderId=a.OrderId and aop.ResourceType=10" : "")}
{where} {((userInfo?.SimpleEasy ?? 0) == 1 ? " GROUP BY a.OrderId " : "")} ";
{(!string.IsNullOrEmpty(model.ContactName) ? " left join rb_travel_guest g on A.OrderId=g.OrderId and g.IsAllograph=2 and g.Status=0" : "")}
{where} {((userInfo?.SimpleEasy ?? 0) == 1 || !string.IsNullOrEmpty(model.ContactName) ? " GROUP BY a.OrderId " : "")} ";
}
string orderby;
if (model.Sort == 1)
......@@ -1588,7 +1589,7 @@ left join rb_lineteam E on E.LtID=C.LineteamId
//}
if (!string.IsNullOrWhiteSpace(model.ContactName))
{
where += $@" AND A.{nameof(RB_Travel_Order.ContactName)} like '%{model.ContactName}%'";
where += $@" AND (A.{nameof(RB_Travel_Order.ContactName)} like '%{model.ContactName}%' or g.Name like '%{model.ContactName}%')";
}
if (model.GroupType > 0)
{
......@@ -1695,8 +1696,9 @@ LEFT JOIN rb_travel_config AS C ON c.ID=B.ConfigID
left join rb_line D on D.LineID=C.LineId
left join rb_lineteam E on E.LtID=C.LineteamId
{((userInfo != null && (userInfo?.SimpleEasy ?? 0) == 1) ? " left JOIN rb_appoint_op aop on aop.OrderId=a.OrderId and aop.ResourceType=10" : "")}
{where} {((userInfo != null && (userInfo?.SimpleEasy ?? 0) == 1) ? " GROUP BY a.OrderId ) as A " : "")} ";
return Get<RB_Travel_Order_Extend>(sql).FirstOrDefault();
{(!string.IsNullOrEmpty(model.ContactName) ? " left join rb_travel_guest g on A.OrderId=g.OrderId and g.IsAllograph=2 and g.Status=0" : "")}
{where} {((userInfo?.SimpleEasy ?? 0) == 1 || !string.IsNullOrEmpty(model.ContactName) ? " GROUP BY a.OrderId ) as A " : "")} ";
return Get<RB_Travel_Order_Extend>(sql).FirstOrDefault();
}
/// <summary>
......
......@@ -230,11 +230,11 @@ WHERE o.GroupId ={rB_Group_id} and o.IsSaleDrainage =1 and o.OrderStatus <>2 and
{
where += $@" and t.{nameof(RB_CRMTicket_Order_Extend.EmpBranchId)} ={demodel.EmpBranchId}";
}
//if (!string.IsNullOrEmpty(demodel.GuestName))
//{
// where += $@" and concat(g.SurName,g.Name) like @GuestName";
// parameters.Add("GuestName", "%" + demodel.GuestName.Trim() + "%");
//}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
where += $@" and g.Name like @GuestName";
parameters.Add("GuestName", "%" + demodel.GuestName.Trim() + "%");
}
if (demodel.IsMyOrder == 1)
{
//查询我的订单 新增对引流人员查看支持
......@@ -322,6 +322,7 @@ SELECT t.*,cd.Commission
FROM RB_Ticket_Order t
left JOIN {(Config.IsOnline ? "uat_reborn_dmc" : "reborn_dmc")}.rb_appoint_op aop on aop.OrderId=t.OrderId and aop.ResourceType=8
left join (select d.OrderId,sum(d.Commission) as Commission from rb_ticket_commission_details d where d.Status =0 group by d.OrderId) cd on t.OrderId = cd.OrderId
{(!string.IsNullOrEmpty(demodel.GuestName) ? $" left join {(Config.IsOnline ? "uat_reborn_dmc" : "reborn_dmc")}.rb_travel_guest g on t.OrderId=g.OrderId and g.IsAllograph=5 and g.Status=0" : "")}
WHERE {where}
group by t.OrderId
ORDER BY t.CreateTime DESC";
......@@ -361,11 +362,11 @@ ORDER BY t.CreateTime DESC";
{
where += $@" and t.{nameof(RB_CRMTicket_Order_Extend.GuestId)} ={demodel.GuestId}";
}
//if (!string.IsNullOrEmpty(demodel.GuestName))
//{
// where += $@" and concat(g.SurName,g.Name) like @GuestName";
// parameters.Add("GuestName", "%" + demodel.GuestName.Trim() + "%");
//}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
where += $@" and g.Name like @GuestName";
parameters.Add("GuestName", "%" + demodel.GuestName.Trim() + "%");
}
if (demodel.IsMyOrder == 1)
{
//查询我的订单 新增对引流人员查看支持
......@@ -455,6 +456,7 @@ from(
select t.*
FROM RB_Ticket_Order t
left JOIN {(Config.IsOnline ? "uat_reborn_dmc" : "reborn_dmc")}.rb_appoint_op aop on aop.OrderId=t.OrderId and aop.ResourceType=8
{(!string.IsNullOrEmpty(demodel.GuestName) ? $" left join {(Config.IsOnline ? "uat_reborn_dmc" : "reborn_dmc")}.rb_travel_guest g on t.OrderId=g.OrderId and g.IsAllograph=5 and g.Status=0" : "")}
WHERE {where} group by t.OrderId)t2 ";
return Get<RB_CRMTicket_Order_Extend>(sql, parameters).FirstOrDefault();
}
......
......@@ -5580,6 +5580,7 @@ namespace REBORN.Services.DMCService
OpEmpId = parm.GetInt("OpEmpId"),
FinishSDate = parm.GetStringValue("FinishSDate"),
FinishEDate = parm.GetStringValue("FinishEDate"),
ContactName = parm.GetStringValue("ContactName"),
};
OrderInfo.RB_Group_Id = userInfo.RB_Group_id;
var list = visaModule.GetOrderVisaOrderList(pmodel.pageIndex, pmodel.pageSize, OrderInfo, userInfo, out long count, IsAdmin: true);
......
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