Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
huatu_API
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liudong1993
huatu_API
Commits
d60b9707
Commit
d60b9707
authored
Aug 20, 2025
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入旅客信息
parent
f76694f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
261 additions
and
4 deletions
+261
-4
VisaModule.cs
REBORN.Module.DMCModule/VisaModule.cs
+139
-0
CustomerOrderModule.cs
REBORN.Module.SellModule/CustomerOrderModule.cs
+103
-1
SellOrderModule.cs
REBORN.Module.SellModule/SellOrderModule.cs
+5
-2
DMCFileUploadService.cs
REBORN.Services.DMCService/DMCFileUploadService.cs
+14
-1
No files found.
REBORN.Module.DMCModule/VisaModule.cs
View file @
d60b9707
using
DapperExtensions.Lambda
;
using
Newtonsoft.Json
;
using
REBORN.Common
;
using
REBORN.Common.API
;
using
REBORN.Common.Enum
;
using
REBORN.Common.Enum.Log
;
using
REBORN.Common.Pay.WeChatPat
;
...
...
@@ -2603,6 +2604,144 @@ TEL:03-3779-9111";
}
}
/// <summary>
/// 导入旅客信息
/// </summary>
/// <param name="FileName"></param>
/// <param name="orderId">订单id</param>
/// <param name="EmployeeId">员工编号</param>
/// <returns></returns>
public
object
ImpoertGuest_YL
(
string
FileName
,
int
orderId
,
string
EmployeeId
)
{
if
(
string
.
IsNullOrWhiteSpace
(
FileName
))
{
return
ApiResult
.
Success
(
"请选择需要导入的EXCEL!"
);
}
var
list
=
REBORN
.
Data
.
Guest
.
GuestDataHelper
.
ImpoertGuestData
(
FileName
,
1
);
if
(
orderId
>
0
)
{
var
trans
=
GuestRepository
.
DbTransaction
;
try
{
//获取订单信息
var
orderModel
=
sell_VisaOrderRepository
.
GetEntity
(
orderId
);
UserInfo
userInfo
=
CacheManager
.
User
.
RbUserCache
.
GetUserLoginInfo
(
string
.
IsNullOrWhiteSpace
(
EmployeeId
)
?
orderModel
.
CreateBy
.
ToString
()
:
EmployeeId
);
#
region
更新订单
同时查询旅客名单是否需要删除
RB_Travel_Guest_Extend
dmodel1
=
new
RB_Travel_Guest_Extend
{
OrderId
=
orderId
,
IsAllograph
=
1
};
var
guestList
=
GuestRepository
.
GetPeopleList
(
dmodel1
).
OrderByDescending
(
x
=>
x
.
Id
).
ToList
();
// 获取数据库中的旅客列表并按Id降序排列
var
dbGuestList
=
guestList
;
var
newGuestList
=
list
;
// 创建字典提高查找效率
var
dbGuestDict
=
dbGuestList
.
ToDictionary
(
g
=>
g
.
Name
,
g
=>
g
);
var
newGuestDict
=
newGuestList
.
ToDictionary
(
g
=>
g
.
Name
,
g
=>
g
);
// 找出需要删除的旅客
var
guestsToRemove
=
dbGuestList
.
Where
(
g
=>
!
newGuestDict
.
ContainsKey
(
g
.
Name
)).
ToList
();
foreach
(
var
guest
in
guestsToRemove
)
{
Dictionary
<
string
,
object
>
gfiles
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Travel_Guest
.
Status
),
1
}
};
List
<
WhereHelper
>
gwheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Travel_Guest
.
Id
),
FiledValue
=
guest
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
GuestRepository
.
Update
(
gfiles
,
gwheres
,
trans
);
}
// 处理新增和修改
foreach
(
var
newGuest
in
newGuestList
)
{
if
(
dbGuestDict
.
TryGetValue
(
newGuest
.
Name
,
out
var
existingGuest
))
{
var
nowGuest
=
guestList
.
FirstOrDefault
(
x
=>
x
.
Name
==
newGuest
.
Name
)
??
new
RB_Travel_Guest_Extend
();
Dictionary
<
string
,
object
>
gfiles
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Travel_Guest
.
Name
),
newGuest
.
Name
},
{
nameof
(
RB_Travel_Guest
.
IdCard
),
newGuest
.
IdCard
},
{
nameof
(
RB_Travel_Guest
.
PassportExpiry
),
newGuest
.
PassportExpiry
},
{
nameof
(
RB_Travel_Guest
.
PassportIssued
),
newGuest
.
PassportIssued
},
{
nameof
(
RB_Travel_Guest
.
PassportNo
),
newGuest
.
PassportNo
},
{
nameof
(
RB_Travel_Guest
.
Birthday
),
newGuest
.
Birthday
},
{
nameof
(
RB_Travel_Guest
.
Tel
),
newGuest
.
MobilePhone
},
};
List
<
WhereHelper
>
gwheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Travel_Guest
.
Id
),
FiledValue
=
nowGuest
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
GuestRepository
.
Update
(
gfiles
,
gwheres
,
trans
);
}
else
{
// 新增记录
GuestRepository
.
Insert
(
new
RB_Travel_Guest
()
{
Id
=
0
,
TCID
=
0
,
OrderId
=
orderModel
.
Id
,
SurName
=
newGuest
.
SurName
,
Name
=
newGuest
.
Name
,
Sex
=
newGuest
.
Sex
,
ESurName
=
newGuest
.
ESurName
,
EName
=
newGuest
.
EName
,
Birthday
=
newGuest
.
Birthday
,
PassportNo
=
newGuest
.
PassportNo
,
Nationality
=
2
,
//默认中国
EconomicCapability
=
"[]"
,
Remarks
=
""
,
Tel
=
newGuest
.
MobilePhone
,
MobilePhone
=
newGuest
.
MobilePhone
,
Status
=
0
,
TravelType
=
0
,
UnitType
=
0
,
DutyType
=
0
,
CreateBy
=
userInfo
.
EmployeeId
,
UpdateBy
=
userInfo
.
EmployeeId
,
CreateDate
=
DateTime
.
Now
,
UpdateDate
=
DateTime
.
Now
,
IsAllograph
=
2
,
IsBed
=
1
},
trans
);
}
}
#
endregion
GuestRepository
.
DBSession
.
Commit
();
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"ImpoertGuest"
);
GuestRepository
.
DBSession
.
Rollback
(
"ImpoertGuest"
);
return
false
;
}
}
var
result
=
list
?.
Select
(
subItem
=>
new
{
Tel
=
subItem
?.
MobilePhone
??
""
,
IdCard
=
subItem
?.
IdCard
??
""
,
PassportNo
=
subItem
?.
PassportNo
??
""
,
PassportExpiry
=
StringHelper
.
FormatDate
(
subItem
.
PassportExpiry
),
PassportIssued
=
StringHelper
.
FormatDate
(
subItem
.
PassportIssued
),
Birthday
=
StringHelper
.
FormatDate
(
subItem
.
Birthday
),
userName
=
subItem
.
SurName
+
subItem
.
Name
,
SexStr
=
subItem
.
Sex
==
1
?
"男"
:
subItem
.
Sex
==
2
?
"女"
:
"保密"
,
Age
=
subItem
.
Birthday
.
HasValue
?
System
.
DateTime
.
Now
.
Year
-
subItem
.
Birthday
.
Value
.
Year
:
0
,
subItem
.
MobilePhone
});
return
JsonHelper
.
GetCamelCaseResultJson
(
result
);
}
public
bool
SetVisaOrder_V2
(
RB_Sell_VisaOrder
model
,
RB_Sell_VisaProduct_Extend
VisaProductModel
,
RB_Sell_VisaOrder
tempModel
,
bool
IsUpdateTCNum
,
RB_Supplier
supplierModel
,
List
<
RB_Appoint_OP
>
appointOPList
,
List
<
OrderGuestList
>
orderGuestList
,
string
updateCouponAllotIds
=
""
)
{
var
trans
=
sell_VisaOrderRepository
.
DbTransaction
;
...
...
REBORN.Module.SellModule/CustomerOrderModule.cs
View file @
d60b9707
...
...
@@ -2,6 +2,7 @@
using
Newtonsoft.Json
;
using
Org.BouncyCastle.Asn1.Cmp
;
using
REBORN.Common
;
using
REBORN.Common.API
;
using
REBORN.Common.EMail
;
using
REBORN.Common.Enum
;
using
REBORN.Common.Enum.Sell
;
...
...
@@ -13,6 +14,7 @@ using REBORN.Model.Extend;
using
REBORN.Model.Extend.Dmc
;
using
REBORN.Model.Extend.Finance
;
using
REBORN.Model.Extend.Sell
;
using
REBORN.Module.DMCModule
;
using
REBORN.Repository
;
using
REBORN.Repository.Dmc
;
using
REBORN.Repository.Finance
;
...
...
@@ -21,6 +23,7 @@ using REBORN.Repository.Sell;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
REBORN.Module.SellModule
...
...
@@ -1314,7 +1317,7 @@ namespace REBORN.Module.SellModule
query
.
EnterID
=
0
;
}
}
var
list
=
hotelOrderRepository
.
GetMyCustomerOrderPageList
(
pageIndex
,
pageSize
,
out
count
,
query
,
(
IsAdmin
?
userInfo
:
null
));
if
(
list
.
Any
())
{
...
...
@@ -3104,6 +3107,105 @@ namespace REBORN.Module.SellModule
/// <summary>
/// 导入旅客信息
/// </summary>
/// <param name="FileName"></param>
/// <param name="orderId">订单id</param>
/// <param name="EmployeeId">员工编号</param>
/// <returns></returns>
public
object
ImpoertGuest_YL
(
string
FileName
,
int
orderId
,
string
EmployeeId
,
string
Type
)
{
if
(
string
.
IsNullOrWhiteSpace
(
FileName
))
{
return
ApiResult
.
Success
(
"请选择需要导入的EXCEL!"
);
}
var
list
=
REBORN
.
Data
.
Guest
.
GuestDataHelper
.
ImpoertGuestData
(
FileName
,
1
);
if
(
orderId
>
0
)
{
try
{
List
<
OrderGuestList
>
orderGuestList
=
new
List
<
OrderGuestList
>();
string
guestInfoStr
=
""
;
if
(
list
!=
null
&&
list
.
Any
())
{
foreach
(
var
item
in
list
)
{
orderGuestList
.
Add
(
new
OrderGuestList
{
Birthday
=
item
.
Birthday
,
Name
=
item
.
Name
,
IdCard
=
item
.
Name
,
PassportExpiry
=
item
.
PassportExpiry
,
PassportIssued
=
item
.
PassportIssued
,
PassportNo
=
item
.
PassportNo
,
Tel
=
item
.
MobilePhone
,
});
}
guestInfoStr
=
JsonConvert
.
SerializeObject
(
orderGuestList
);
}
//Type=1酒店 3-邮轮 8-单机票 9-签证 10-跟团游
if
(
Type
==
"1"
)
{
//获取订单信息
var
orderModel
=
hotelOrderRepository
.
GetEntity
(
orderId
);
UserInfo
userInfo
=
CacheManager
.
User
.
RbUserCache
.
GetUserLoginInfo
(
string
.
IsNullOrWhiteSpace
(
EmployeeId
)
?
orderModel
.
EnterID
.
ToString
()
:
EmployeeId
);
IDictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Customer_HotelOrder
.
GuestInfo
),
guestInfoStr
},
{
nameof
(
RB_Customer_HotelOrder
.
UpdateBy
),
userInfo
.
EmployeeId
},
{
nameof
(
RB_Customer_HotelOrder
.
UpdateTime
),
DateTime
.
Now
},
};
IList
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Customer_HotelOrder
.
OrderId
),
FiledValue
=
orderModel
.
OrderId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
hotelOrderRepository
.
Update
(
fileds
,
whereHelpers
);
}
else
if
(
Type
==
"3"
)
{
//获取订单信息
var
orderModel
=
customer_TicketOrderRepository
.
GetEntity
(
orderId
);
UserInfo
userInfo
=
CacheManager
.
User
.
RbUserCache
.
GetUserLoginInfo
(
string
.
IsNullOrWhiteSpace
(
EmployeeId
)
?
orderModel
.
EnterID
.
ToString
()
:
EmployeeId
);
IDictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Customer_TicketOrder
.
GuestInfo
),
guestInfoStr
},
{
nameof
(
RB_Customer_TicketOrder
.
UpdateBy
),
userInfo
.
EmployeeId
},
{
nameof
(
RB_Customer_TicketOrder
.
UpdateTime
),
DateTime
.
Now
},
};
IList
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Customer_TicketOrder
.
OrderId
),
FiledValue
=
orderModel
.
OrderId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
customer_TicketOrderRepository
.
Update
(
fileds
,
whereHelpers
);
}
else
if
(
Type
==
"8"
)
{
//获取订单信息
var
orderModel
=
cRMTicket_OrderRepository
.
GetEntity
(
orderId
);
UserInfo
userInfo
=
CacheManager
.
User
.
RbUserCache
.
GetUserLoginInfo
(
string
.
IsNullOrWhiteSpace
(
EmployeeId
)
?
orderModel
.
EnterID
.
ToString
()
:
EmployeeId
);
IDictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
REBORN
.
Model
.
Entity
.
Sell
.
RB_Ticket_Order
.
GuestInfo
),
guestInfoStr
},
};
IList
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
REBORN
.
Model
.
Entity
.
Sell
.
RB_Ticket_Order
.
OrderId
),
FiledValue
=
orderModel
.
OrderId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
cRMTicket_OrderRepository
.
Update
(
fileds
,
whereHelpers
);
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"ImpoertGuest"
);
return
false
;
}
}
var
result
=
list
?.
Select
(
subItem
=>
new
{
Tel
=
subItem
?.
MobilePhone
??
""
,
IdCard
=
subItem
?.
IdCard
??
""
,
PassportNo
=
subItem
?.
PassportNo
??
""
,
PassportExpiry
=
StringHelper
.
FormatDate
(
subItem
.
PassportExpiry
),
PassportIssued
=
StringHelper
.
FormatDate
(
subItem
.
PassportIssued
),
Birthday
=
StringHelper
.
FormatDate
(
subItem
.
Birthday
),
userName
=
subItem
.
SurName
+
subItem
.
Name
,
SexStr
=
subItem
.
Sex
==
1
?
"男"
:
subItem
.
Sex
==
2
?
"女"
:
"保密"
,
Age
=
subItem
.
Birthday
.
HasValue
?
System
.
DateTime
.
Now
.
Year
-
subItem
.
Birthday
.
Value
.
Year
:
0
,
subItem
.
MobilePhone
});
return
JsonHelper
.
GetCamelCaseResultJson
(
result
);
}
/// <summary>
/// 新增修改订单 (邮轮)
...
...
REBORN.Module.SellModule/SellOrderModule.cs
View file @
d60b9707
...
...
@@ -5322,6 +5322,7 @@ namespace REBORN.Module.SellModule
EconomicCapability = "[]",
Remarks = newGuest.Remarks,
MobilePhone = newGuest.MobilePhone,
Tel = newGuest.MobilePhone,
Status = 0,
TravelType = 0,
UnitType = 0,
...
...
@@ -6095,6 +6096,7 @@ namespace REBORN.Module.SellModule
EconomicCapability = "[]",
Remarks = item.Remarks,
MobilePhone = item.MobilePhone,
Tel = item.MobilePhone,
Status = 0,
TravelType = 0,
UnitType = 0,
...
...
@@ -22666,6 +22668,7 @@ namespace REBORN.Module.SellModule
EconomicCapability = "[]",
Remarks = orderModel.Remarks,
MobilePhone = newGuest.MobilePhone,
Tel = newGuest.MobilePhone,
Status = 0,
TravelType = 0,
UnitType = 0,
...
...
@@ -22690,8 +22693,8 @@ namespace REBORN.Module.SellModule
return false;
}
}
var result = list?.Select(subItem => new {
Tel = subItem?.MobilePhone ?? "", IdCard = subItem?.IdCard ?? "", PassportNo = subItem?.PassportNo ?? "", PassportExpiry = StringHelper.FormatDate(subItem.PassportExpiry), PassportIssued = StringHelper.FormatDate(subItem.PassportIssued), Birthday = StringHelper.FormatDate(subItem.Birthday), userName = subItem.SurName + subItem.Name, SexStr = subItem.Sex == 1 ? "男" : subItem.Sex == 2 ? "女" : "保密", Age = subItem.Birthday.HasValue ? System.DateTime.Now.Year - subItem.Birthday.Value.Year : 0, subItem.MobilePhone });
return
result
;
var result = list?.Select(subItem => new { Tel = subItem?.MobilePhone ?? "", IdCard = subItem?.IdCard ?? "", PassportNo = subItem?.PassportNo ?? "", PassportExpiry = StringHelper.FormatDate(subItem.PassportExpiry), PassportIssued = StringHelper.FormatDate(subItem.PassportIssued), Birthday = StringHelper.FormatDate(subItem.Birthday), userName = subItem.SurName + subItem.Name, SexStr = subItem.Sex == 1 ? "男" : subItem.Sex == 2 ? "女" : "保密", Age = subItem.Birthday.HasValue ? System.DateTime.Now.Year - subItem.Birthday.Value.Year : 0, subItem.MobilePhone });
return
JsonHelper.GetCamelCaseResultJson(result)
;
}
#endregion
REBORN.Services.DMCService/DMCFileUploadService.cs
View file @
d60b9707
...
...
@@ -144,6 +144,7 @@ namespace REBORN.Services.DMCService
string
groupId
=
parm
[
"GroupId"
];
//W 2019-11-20 财务未认款导入需要
string
OrderId
=
parm
[
"OrderId"
];
//W 2019-09-4 导入旅客名单需要订单id
string
OrderType
=
parm
[
"OrderType"
];
//W 2019-09-4 导入旅客名单需要订单id
string
KingdeeBId
=
parm
[
"KingdeeBId"
];
//ld 2022-08-16 金蝶账套公司
...
...
@@ -764,7 +765,19 @@ namespace REBORN.Services.DMCService
string
filePath
=
"/Upload/DMC/OrderGuest/"
+
ossFilename
;
try
{
obj
=
sellOrderModule
.
ImpoertGuest_YL
(
fileUrl
,
Convert
.
ToInt32
(
OrderId
),
EmployeeId
);
//Type=1酒店 3-邮轮 8-单机票 9-签证 10-跟团游
if
(
OrderType
==
"1"
||
OrderType
==
"3"
||
OrderType
==
"8"
)
//酒店
{
obj
=
new
REBORN
.
Module
.
SellModule
.
CustomerOrderModule
().
ImpoertGuest_YL
(
fileUrl
,
Convert
.
ToInt32
(
OrderId
),
EmployeeId
,
OrderType
);
}
else
if
(
OrderType
==
"9"
)
//签证
{
obj
=
new
REBORN
.
Module
.
DMCModule
.
VisaModule
().
ImpoertGuest_YL
(
fileUrl
,
Convert
.
ToInt32
(
OrderId
),
EmployeeId
);
}
else
//跟团游
{
obj
=
sellOrderModule
.
ImpoertGuest_YL
(
fileUrl
,
Convert
.
ToInt32
(
OrderId
),
EmployeeId
);
}
}
catch
(
Exception
ex
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment