Commit 10b9b024 authored by 吴春's avatar 吴春

11

parent e084ef22
......@@ -29,8 +29,6 @@ namespace REBORN.Data.Guest
return list;
}
/// <summary>
/// DataRow转实体
/// </summary>
......@@ -79,6 +77,7 @@ namespace REBORN.Data.Guest
{
model.NationalityStr = dr["国籍"].ToString().Trim();
}
model.IsBed = 1;
if (dr.Table.Columns.Contains("是否占床") && !string.IsNullOrEmpty(dr["是否占床"].ToString().Trim()))
{
model.IsBed = dr["是否占床"].ToString().Trim() == "是" ? 1 : 0;
......
......@@ -390,42 +390,7 @@ namespace REBORN.Module.DMCModule
if (travelPrice.LeaderNum > 0)
{
leaderOrder = new RB_Travel_Order() { TCID = model.TCID, CreateBy = userInfo.EmployeeId, RB_Branch_Id = userInfo.RB_Branch_id, RB_Group_Id = userInfo.RB_Group_id, RB_Department_Id = userInfo.RB_Department_Id, GuestNum = travelPrice.LeaderNum };
bool isSucess = travelModule.SetTraverLeaderOrderModule(leaderOrder, out bool isNewOrder, out RB_Travel_OrderHouse orderHouse, trans);
if (isNewOrder && isSucess)
{
int surplusYSeat = travelPrice.LeaderNum.Value + (travelPrice.SurplusYSeat ?? 0);
Dictionary<string, object> priceFileds = new Dictionary<string, object>()
{
{ nameof(RB_Travel_Price_Extend.SurplusYSeat), surplusYSeat}
};
List<WhereHelper> priceHelpers = new List<WhereHelper>()
{
new WhereHelper (nameof(RB_Travel_Price_Extend.TCID),model.TCID)
};
isSuccess = travel_PriceRepository.Update(priceFileds, priceHelpers, trans);
}
else
{
//判断领队人数是否改变
if (isSuccess)
{
RB_Travel_Order oldOrder = new Repository.Dmc.RB_Travel_OrderRepository().GetLeaderOrderByTicd(model.TCID.ToString()).FirstOrDefault();
if (oldOrder != null && oldOrder.GuestNum != travelPrice.LeaderNum)
{
int oldSurplusYSeat = ((travelPrice.SurplusYSeat ?? 0) - oldOrder.GuestNum.Value);//还原之前的占位
int surplusYSeat = oldSurplusYSeat + travelPrice.LeaderNum.Value;//加上现有的领队人数
Dictionary<string, object> priceFileds = new Dictionary<string, object>()
{
{ nameof(RB_Travel_Price_Extend.SurplusYSeat), surplusYSeat}
};
List<WhereHelper> priceHelpers = new List<WhereHelper>()
{
new WhereHelper (nameof(RB_Travel_Price_Extend.TCID),model.TCID)
};
isSuccess = travel_PriceRepository.Update(priceFileds, priceHelpers, trans);
}
}
}
bool isSucess = travelModule.SetTraverLeaderOrderModule(leaderOrder,out RB_Travel_OrderHouse orderHouse, trans);
#endregion
RB_Travel_Guest peopleModel = guestRepository.GetLeaderGuest(leaderOrder.OrderId, model.TCID.Value).FirstOrDefault() ?? new RB_Travel_Guest();
#region 旅客名单设置
......
This diff is collapsed.
......@@ -243,6 +243,86 @@ namespace REBORN.Module.DMCModule
return flag;
}
/// <summary>
/// 复制团期
/// </summary>
/// <param name="oldTCID"></param>
/// <param name="startDate"></param>
/// <param name="NewConfigId"></param>
/// <returns></returns>
public bool CopyTravelPriceModule(int oldTCID, string startDate, out int NewConfigId, UserInfo user)
{
bool flag = false;
NewConfigId = 0;
var priceModel = priceRepository.GetEntity<RB_Travel_Price_Extend>(oldTCID);
var oldConfigModel = configRepository.GetTravelConfigEntity(priceModel.ConfigID, isGetFeature: true, isGetJourney: true, isGetShop: true, isGetSelfpaying: true);
oldConfigModel.ID = 0;
oldConfigModel.TravelInfoIsCopy = true;
oldConfigModel.RB_Group_Id = user.RB_Group_id;
oldConfigModel.RB_Branch_Id = user.RB_Branch_id;
oldConfigModel.UpdateBy = user.EmployeeId;
priceModel.TCID = 0;
priceModel.ConfigID = NewConfigId;
priceModel.TCNUM = "";
priceModel.StartDate = Convert.ToDateTime(startDate);
priceModel.SurplusCSeat = 0;
priceModel.SurplusFSeat = 0;
priceModel.SurplusYSeat = 0;
priceModel.AirTicketId = 0;
priceModel.DMCNum = "";
priceModel.CombinationNum = "";
priceModel.RB_Group_Id = user.RB_Group_id;
priceModel.RB_Branch_Id = user.RB_Branch_id;
priceModel.CreateBy = user.EmployeeId;
priceModel.CreateDate = DateTime.Now;
priceModel.UpdateBy = 0;
priceModel.UpdateDate = DateTime.Now;
priceModel.OfferId = 0;
priceModel.FenFangUrl = "";
var priceFlightList = GetPriceFlightModule(oldTCID.ToString());
priceModel.PriceFlight = new List<RB_Travel_Price_Flight_Extend>();
if (priceFlightList != null && priceFlightList.Count > 0)
{
foreach (var fItem in priceFlightList)
{
priceModel.PriceFlight.Add(new RB_Travel_Price_Flight_Extend()
{
ID = 0,
FlightId = fItem.FlightId,
TCID = 0,
StartDate = fItem.StartDate,
TicketType = fItem.TicketType,
IsTransfer = fItem.IsTransfer,
CreateDate = DateTime.Now,
DepartureTime = fItem.DepartureTime,
ArrivalTime = fItem.ArrivalTime,
SortNum = fItem.SortNum,
FlightNumber = fItem.FlightNumber,
IssuanceDate = fItem.IssuanceDate,
AlName = fItem.AlName,
DepartCity = fItem.DepartCity,
DepartureAirPortName = fItem.DepartureAirPortName,
ArrivalCity = fItem.ArrivalCity,
ArrivalAirPortName = fItem.ArrivalAirPortName,
SpanDay = fItem.SpanDay,
CabinName = fItem.CabinName
});
}
}
oldConfigModel.PriceList = new List<RB_Travel_Price_Extend>() { priceModel };
flag = SetTravelConfigInfoModule(oldConfigModel, out NewConfigId, isUpdateJourney: true);
if (flag && oldConfigModel.Feature != null && oldConfigModel.Feature.ID > 0)
{
oldConfigModel.Feature.ID = 0;
oldConfigModel.Feature.ConfigId = NewConfigId;
SetFeature(oldConfigModel.Feature);
}
return flag;
}
/// <summary>
/// 团队酒店变更
/// </summary>
......
This diff is collapsed.
......@@ -361,7 +361,7 @@ namespace REBORN.Services.DMCService
}
else if (Type == "6")
{
object obj = null;
ApiResult obj = null;
string filePath = "/Upload/DMC/OrderGuest/" + ossFilename;
try
{
......@@ -371,15 +371,14 @@ namespace REBORN.Services.DMCService
{
Common.Plugin.LogHelper.Write(ex, "LocalFileUpload");
}
DeleteFile(fileUrl);
if (obj != null)
if (obj != null && obj.resultCode == (int)ResultCode.Success)
{
return new ApiResult { resultCode = (int)ResultCode.Success, message = "上传成功!", data = obj };
}
else
{
return ApiResult.Failed(message: "上传失败!");
return ApiResult.Failed(message: "上传失败!" + obj.message);
}
}
else if (Type == "7")
......
......@@ -309,8 +309,8 @@ namespace REBORN.Services.DMCService
};
UserInfo userInfo1 = CacheManager.User.RbUserCache.GetUserLoginInfo(request.uid);
UserInfo userInfo = CacheManager.User.RbUserCache.GetUserLoginInfo(model.CreateBy.ToString());
model.CreateBy = userInfo.EmployeeId;
model.RB_Department_Id = userInfo.RB_Department_Id;
model.CreateBy = userInfo?.EmployeeId??0;
model.RB_Department_Id = userInfo?.RB_Department_Id ?? 0;
var list = module.GetAirticketPurchaseListModule(model, userInfo1, Convert.ToInt32(model.AirticketId));
return ApiResult.Success(data: list.Select(qitem => new
{
......
......@@ -433,6 +433,7 @@ namespace REBORN.Services.DMCService
SafeMoney = pObj.GetDecimal("SafeMoney"),
IsOrder = pObj.GetInt("IsOrder"),
TeamType = TeamTypeEnum.Normal,
IsLeaderUseSeat=1,//默认领队占机位(有需要再从前端传递参数)
};
string extPriceInfoStr = pObj.GetStringValue("ExtPriceInfo");
List<PWSaleItem> PlatformPriceList = new List<PWSaleItem>();
......@@ -542,6 +543,21 @@ namespace REBORN.Services.DMCService
return flag ? ApiResult.Success(data: NewConfigId) : ApiResult.Failed();
}
/// <summary>
/// 复制团期
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public virtual ApiResult CopyTravelPrice(RequestParm request)
{
var userInfo = CacheManager.User.RbUserCache.GetUserLoginInfo(request.uid);
JObject jObj = JObject.Parse(request.msg.ToString());
int oldTCID = jObj.GetInt("TCID");
string StartDate = jObj.GetStringValue("StartDate");
bool flag = module.CopyTravelPriceModule(oldTCID, StartDate, out int NewConfigId, userInfo);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 酒店下架、变更、重新同步
......
......@@ -10420,21 +10420,21 @@ namespace REBORN.Services.SellService
//不需要的数量已经录入完毕
if (dmodel.IsNeedAirticket == 2)
{
return ApiResult.ParamIsNull("单地接必选!");
//return ApiResult.ParamIsNull("单地接必选!");
}
}
if (gmodel.VisaNum >= (model.GuestNum - model.VisaNum))
{
if (dmodel.IsVisaFree == 1)
{
return ApiResult.ParamIsNull("签证必选!");
//return ApiResult.ParamIsNull("签证必选!");
}
}
if (gmodel.SafeNum >= (model.GuestNum - model.SafeNum))
{
if (dmodel.IsNeedSafe == 2)
{
return ApiResult.ParamIsNull("保险必选!");
//return ApiResult.ParamIsNull("保险必选!");
}
}
}
......@@ -10504,7 +10504,7 @@ namespace REBORN.Services.SellService
//验证占房的数量是否录入完毕!
if (sellOrderModule.ValidateSleepOutFull(model, dmodel.OrderId ?? 0, dmodel.Id, 1))
{
return ApiResult.ParamIsNull("该订单下占房旅客已经录入完毕,请核实后再试!");
// return ApiResult.ParamIsNull("该订单下占房旅客已经录入完毕,请核实后再试!");
}
}
else
......@@ -10514,7 +10514,7 @@ namespace REBORN.Services.SellService
//验证占房的数量是否录入完毕!
if (sellOrderModule.ValidateSleepOutFull(model, dmodel.OrderId ?? 0, dmodel.Id, 5))
{
return ApiResult.ParamIsNull("该订单下不占房旅客已经录入完毕,请核实后再试!");
// return ApiResult.ParamIsNull("该订单下不占房旅客已经录入完毕,请核实后再试!");
}
}
}
......@@ -10523,7 +10523,7 @@ namespace REBORN.Services.SellService
//验证非免签 是否录入完毕
if (sellOrderModule.ValidateSleepOutFull(model, dmodel.OrderId ?? 0, dmodel.Id, 2))
{
return ApiResult.ParamIsNull("该订单下需签证旅客已经录入完毕,请核实后再试!");
// return ApiResult.ParamIsNull("该订单下需签证旅客已经录入完毕,请核实后再试!");
}
}
}
......@@ -10533,7 +10533,7 @@ namespace REBORN.Services.SellService
//验证需要机票 是否录入完毕
if (sellOrderModule.ValidateSleepOutFull(model, dmodel.OrderId ?? 0, dmodel.Id, 3))
{
return ApiResult.ParamIsNull("该订单下单地接旅客已经录入完毕,请核实后再试!");
//return ApiResult.ParamIsNull("该订单下单地接旅客已经录入完毕,请核实后再试!");
}
}
if (dmodel.IsNeedSafe == 1)
......@@ -10541,7 +10541,7 @@ namespace REBORN.Services.SellService
//验证需要保险 是否录入完毕
if (sellOrderModule.ValidateSleepOutFull(model, dmodel.OrderId ?? 0, dmodel.Id, 4))
{
return ApiResult.ParamIsNull("该订单下需保险旅客已经录入完毕,请核实后再试!");
// return ApiResult.ParamIsNull("该订单下需保险旅客已经录入完毕,请核实后再试!");
}
}
//if (dmodel.Nationality <= 0)
......
......@@ -3080,15 +3080,8 @@ namespace REBORN.Services.SellService
if ((orderModel?.RedEnvelopeMoney ?? 0) > 0) { return ApiResult.Failed("无法恢复幸福存在抵扣订单"); }
int TCID = orderModel?.TCID ?? 0;
int oldGuestNum = sellOrderModule.GetTravelOrderGuestNumModule(TCID);
bool flag = sellOrderModule.RecoverOrderModule(OrderId);
if (flag)
{
int newGuestNum = sellOrderModule.GetTravelOrderGuestNumModule(TCID);
if (oldGuestNum != newGuestNum)
{
sellOrderModule.PushOrderNumChangeMessageModule(TCID, oldGuestNum, newGuestNum);
}
}
var TModel = sellOrderModule.GetTravelInfoExt(orderModel.TCID ?? 0);
bool flag = sellOrderModule.RecoverOrderModule(OrderId, TModel);
return flag ? ApiResult.Success(message: "恢复订单成功!") : ApiResult.Failed(message: "恢复订单失败!");
}
......
......@@ -293,7 +293,7 @@
"method": "GetTravelSelectEnum"
},
{
"cmd": "travel_post_SetTCState", //设置团控上架、下架
"cmd": "travel_post_SetTCState", //设置上架平台
"fullName": "REBORN.Services.DMCService.TravelService",
"method": "SetTCState"
},
......@@ -614,6 +614,12 @@
"checkFormRepeatSubmit": true, //验证表单重复提交
"method": "SetTravelConfigChangeDT"
},
{
"cmd": "travel_post_CopyTravelPrice", //团队复制
"fullName": "REBORN.Services.DMCService.TravelService",
"checkFormRepeatSubmit": true, //验证表单重复提交
"method": "CopyTravelPrice"
},
{
"cmd": "travel_post_SetTravelHotel", //变更酒店
"fullName": "REBORN.Services.DMCService.TravelService",
......
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