|
@@ -1069,6 +1069,135 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+
|
|
|
+ #region 根据团ID获取各板块操作人
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取 团组模块操作人
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="groupId"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static List<GroupOperationUserView> GetGroupModuleOperators(int groupId)
|
|
|
+ {
|
|
|
+ var modoule = new GroupOperationUserView();
|
|
|
+ var view = modoule.GetOperationUsersInit();
|
|
|
+ if(groupId < 1) return view;
|
|
|
+ var groupInfo = _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
+ .Where(it => it.IsDel == 0 && it.Id == groupId)
|
|
|
+ .First();
|
|
|
+ if (groupInfo == null) return view;
|
|
|
+
|
|
|
+ //获取团组下的操作人
|
|
|
+ //车/导游地接
|
|
|
+ var opUers = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
|
|
|
+ .InnerJoin<Grp_CreditCardPayment>((x,y) => x.Id == y.CId && y.CTable == 79)
|
|
|
+ .LeftJoin<Sys_Users>((x, y, u) => x.CreateUserId == u.Id)
|
|
|
+ .Where((x, y, u) => x.DiId == groupId && x.IsDel == 0)
|
|
|
+ .Select((x, y, u) => new GroupOperationUserInfo
|
|
|
+ {
|
|
|
+ UserId = u.Id,
|
|
|
+ UserName = u.CnName
|
|
|
+ }).Distinct().ToList();
|
|
|
+ view.Where(it => it.CTableId == 79).FirstOrDefault().OperationUsers = opUers;
|
|
|
+
|
|
|
+ //签证
|
|
|
+ var visaUsers = _sqlSugar.Queryable<Grp_VisaInfo>()
|
|
|
+ .InnerJoin<Grp_CreditCardPayment>((x, y) => x.Id == y.CId && y.CTable == 80)
|
|
|
+ .LeftJoin<Sys_Users>((x, y, u) => x.CreateUserId == u.Id)
|
|
|
+ .Where((x, y, u) => x.DIId == groupId && x.IsDel == 0)
|
|
|
+ .Select((x, y, u) => new GroupOperationUserInfo
|
|
|
+ {
|
|
|
+ UserId = u.Id,
|
|
|
+ UserName = u.CnName
|
|
|
+ }).Distinct().ToList();
|
|
|
+ view.Where(it => it.CTableId == 80).FirstOrDefault().OperationUsers = visaUsers;
|
|
|
+
|
|
|
+ //保险
|
|
|
+ var insUsers = _sqlSugar.Queryable<Grp_Customers>()
|
|
|
+ .InnerJoin<Grp_CreditCardPayment>((x, y) => x.Id == y.CId && y.CTable == 82)
|
|
|
+ .LeftJoin<Sys_Users>((x, y, u) => x.CreateUserId == u.Id)
|
|
|
+ .Where((x, y, u) => x.DiId == groupId && x.IsDel == 0)
|
|
|
+ .Select((x, y, u) => new GroupOperationUserInfo
|
|
|
+ {
|
|
|
+ UserId = u.Id,
|
|
|
+ UserName = u.CnName
|
|
|
+ }).Distinct().ToList();
|
|
|
+ view.Where(it => it.CTableId == 82).FirstOrDefault().OperationUsers = insUsers;
|
|
|
+
|
|
|
+ //邀请/公务活动
|
|
|
+ var ioaUsers = _sqlSugar.Queryable<Grp_InvitationOfficialActivities>()
|
|
|
+ .InnerJoin<Grp_CreditCardPayment>((x, y) => x.Id == y.CId && y.CTable == 81)
|
|
|
+ .LeftJoin<Sys_Users>((x, y, u) => x.CreateUserId == u.Id)
|
|
|
+ .Where((x, y, u) => x.DiId == groupId && x.IsDel == 0)
|
|
|
+ .Select((x, y, u) => new GroupOperationUserInfo
|
|
|
+ {
|
|
|
+ UserId = u.Id,
|
|
|
+ UserName = u.CnName
|
|
|
+ }).Distinct().ToList();
|
|
|
+ if (!ioaUsers.Any())
|
|
|
+ {
|
|
|
+ ioaUsers = _sqlSugar.Queryable<Res_OfficialActivities>()
|
|
|
+ .LeftJoin<Sys_Users>((x, y) => x.CreateUserId == y.Id)
|
|
|
+ .Where((x, y) => x.DiId == groupId && x.IsDel == 0)
|
|
|
+ .Select((x, y) => new GroupOperationUserInfo
|
|
|
+ {
|
|
|
+ UserId = y.Id,
|
|
|
+ UserName = y.CnName
|
|
|
+ }).Distinct().ToList();
|
|
|
+ }
|
|
|
+ view.Where(it => it.CTableId == 81).FirstOrDefault().OperationUsers = ioaUsers;
|
|
|
+
|
|
|
+ //其他款项 98
|
|
|
+ var otherUsers = _sqlSugar.Queryable<Grp_DecreasePayments>()
|
|
|
+ .InnerJoin<Grp_CreditCardPayment>((x, y) => x.Id == y.CId && y.CTable == 98)
|
|
|
+ .LeftJoin<Sys_Users>((x, y, u) => x.CreateUserId == u.Id)
|
|
|
+ .Where((x, y, u) => x.DiId == groupId && x.IsDel == 0)
|
|
|
+ .Select((x, y, u) => new GroupOperationUserInfo
|
|
|
+ {
|
|
|
+ UserId = u.Id,
|
|
|
+ UserName = u.CnName
|
|
|
+ }).Distinct().ToList();
|
|
|
+ view.Where(it => it.CTableId == 98).FirstOrDefault().OperationUsers = otherUsers;
|
|
|
+
|
|
|
+ return view;
|
|
|
+ }
|
|
|
+
|
|
|
+ public class GroupOperationUserView
|
|
|
+ {
|
|
|
+ public int CTableId { get; set; }
|
|
|
+ public string CTableName { get; set; }
|
|
|
+ public List<GroupOperationUserInfo> OperationUsers { get; set; }
|
|
|
+
|
|
|
+ public GroupOperationUserView() { }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 默认模块List
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public List<GroupOperationUserView> GetOperationUsersInit()
|
|
|
+ {
|
|
|
+ var modules = new List<GroupOperationUserView>() {
|
|
|
+ new(){ CTableId = 76,CTableName = "酒店预订",
|
|
|
+ OperationUsers=new List<GroupOperationUserInfo>(){ new() {UserId = 226,UserName = "宋夏雨" } } },
|
|
|
+ new(){ CTableId = 79,CTableName = "车/导游地接" },
|
|
|
+ new(){ CTableId = 80,CTableName = "签证" },
|
|
|
+ new(){ CTableId = 82,CTableName = "团组客户保险" },
|
|
|
+ new(){ CTableId = 81,CTableName = "邀请/公务活动" },
|
|
|
+ new(){ CTableId = 85,CTableName = "机票预订",
|
|
|
+ OperationUsers=new List<GroupOperationUserInfo>(){ new() {UserId = 269, UserName = "汪燕平" } } },
|
|
|
+ new(){ CTableId = 98,CTableName = "其他款项" },
|
|
|
+ };
|
|
|
+
|
|
|
+ return modules;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public class GroupOperationUserInfo
|
|
|
+ {
|
|
|
+ public int UserId { get; set; }
|
|
|
+ public string UserName { get; set; }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 团组汇率
|