|
@@ -82,6 +82,8 @@ namespace OASystem.API.Controllers
|
|
|
private readonly HotelInquiryRepository _hotelInquiryRep;
|
|
|
private readonly FeeAuditRepository _feeAuditRep;
|
|
|
|
|
|
+ private readonly VisaCommissionRepository _visaCommissionRep;
|
|
|
+
|
|
|
public GroupsController(ILogger<GroupsController> logger, IMapper mapper, SqlSugarClient sqlSugar, GrpScheduleRepository grpScheduleRep, DelegationInfoRepository groupRepository,
|
|
|
TaskAssignmentRepository taskAssignmentRep, AirTicketResRepository airTicketResRep, DecreasePaymentsRepository decreasePaymentsRep,
|
|
|
InvitationOfficialActivitiesRepository InvitationOfficialActivitiesRep, DelegationEnDataRepository delegationEnDataRep, EnterExitCostRepository enterExitCostRep
|
|
@@ -90,7 +92,7 @@ namespace OASystem.API.Controllers
|
|
|
GroupCostParameterRepository GroupCostParameterRepository, HotelPriceRepository hotelPriceRep, CustomersRepository customersRep, SetDataRepository setDataRep,
|
|
|
TourClientListRepository tourClientListRep, TeamRateRepository teamRateRep, IHubContext<ChatHub, IChatClient> hubContext, UsersRepository usersRep, IJuHeApiService juHeApi,
|
|
|
InvertedListRepository invertedListRep, VisaFeeInfoRepository visaFeeInfoRep, TicketBlackCodeRepository ticketBlackCodeRep, HotelInquiryRepository hotelInquiryRep,
|
|
|
- ThreeCodeRepository threeCodeRepository, FeeAuditRepository feeAuditRep)
|
|
|
+ ThreeCodeRepository threeCodeRepository, FeeAuditRepository feeAuditRep, VisaCommissionRepository visaCommissionRep)
|
|
|
{
|
|
|
_logger = logger;
|
|
|
_mapper = mapper;
|
|
@@ -131,6 +133,7 @@ namespace OASystem.API.Controllers
|
|
|
_hotelInquiryRep = hotelInquiryRep;
|
|
|
_threeCodeRepository = threeCodeRepository;
|
|
|
_feeAuditRep = feeAuditRep;
|
|
|
+ _visaCommissionRep = visaCommissionRep;
|
|
|
}
|
|
|
|
|
|
#region 流程管控
|
|
@@ -6377,6 +6380,50 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+
|
|
|
+ #region 签证提成录入
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 签证提成录入
|
|
|
+ /// 基础数据
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="_dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> VisaCommissionInit()
|
|
|
+ {
|
|
|
+ return Ok(await _visaCommissionRep._Init());
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 签证提成录入
|
|
|
+ /// Item
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="_dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> VisaCommissionItem(VisaCommissionItemDto dto)
|
|
|
+ {
|
|
|
+ var validator = new VisaCommissionItemDtoValidator();
|
|
|
+ var validatorRes = await validator.ValidateAsync(dto);
|
|
|
+ if (!validatorRes.IsValid)
|
|
|
+ {
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ foreach (var item in validatorRes.Errors)
|
|
|
+ {
|
|
|
+ sb.AppendLine(item.ErrorMessage);
|
|
|
+ }
|
|
|
+ return Ok(JsonView(false, sb.ToString()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(await _visaCommissionRep._Init());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region op费用录入
|
|
|
/// <summary>
|
|
|
/// 根据diid查询op费用列表
|
|
@@ -10196,7 +10243,7 @@ ORDER by gctggrc.id DESC
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostHotelReservationsCreateVoucher1(HotelReservationsCreateVoucherDto _dto)
|
|
|
+ public async Task<IActionResult> PostHotelReservationsCreateVoucherOld(HotelReservationsCreateVoucherDto _dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -10204,6 +10251,8 @@ ORDER by gctggrc.id DESC
|
|
|
if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
if (_dto.PageId < 1) _dto.PageId = 28; //酒店预定Id
|
|
|
if (_dto.DiId < 1) return Ok(JsonView(false, "团组Id为空"));
|
|
|
+ if (_dto.Id < 1) return Ok(JsonView(false, "Id为空"));
|
|
|
+
|
|
|
|
|
|
#region 团组操作权限验证 76 酒店预定模块
|
|
|
var groupAuthView = await GeneralMethod.PostGroupOperationAuth(_dto.DiId, _dto.UserId, 76);
|
|
@@ -10233,7 +10282,6 @@ ORDER by gctggrc.id DESC
|
|
|
if (dele != null)
|
|
|
strFileName += dele.TourCode;
|
|
|
|
|
|
-
|
|
|
//载入模板
|
|
|
string sss = AppSettingsHelper.Get("WordBasePath") + "Template/酒店预订模板.doc";
|
|
|
|
|
@@ -10444,11 +10492,9 @@ ORDER by gctggrc.id DESC
|
|
|
{
|
|
|
return Ok(JsonView(false, "该条数据已删除或不存在!"));
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
-
|
|
|
return Ok(JsonView(false, ex.Message));
|
|
|
}
|
|
|
}
|
|
@@ -10616,6 +10662,124 @@ ORDER by gctggrc.id DESC
|
|
|
return Ok(JsonView(true, "操作成功!", Url));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 酒店预订
|
|
|
+ /// 生成VOUCHER 批量生成
|
|
|
+ /// New
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="_dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostHotelReservationsCreateVoucherBatchNew(HotelReservationsCreateVoucherDto _dto)
|
|
|
+ {
|
|
|
+ #region 参数验证
|
|
|
+ if (_dto.UserId < 1) return Ok(JsonView(StatusCodes.Status400BadRequest, "员工Id为空", ""));
|
|
|
+ if (_dto.PageId < 1) _dto.PageId = 28;
|
|
|
+ if (_dto.DiId < 1) return Ok(JsonView(StatusCodes.Status400BadRequest, "团组Id为空", ""));
|
|
|
+
|
|
|
+ #region 团组操作权限验证 76 酒店预定模块
|
|
|
+ var groupAuthView = await GeneralMethod.PostGroupOperationAuth(_dto.DiId, _dto.UserId, 76);
|
|
|
+ if (groupAuthView.Code != 0) return Ok(JsonView(StatusCodes.Status400BadRequest, groupAuthView.Msg, ""));
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
+
|
|
|
+ #region 页面操作权限验证
|
|
|
+ pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
+
|
|
|
+ if (pageFunAuthView.FilesDownloadAuth == 0) return Ok(JsonView(false, "您没有文件下载权限!"));
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ var hrDtas = await _sqlSugar.Queryable<Grp_HotelReservations>()
|
|
|
+ .Where(it => it.IsDel == 0 && it.DiId == _dto.DiId)
|
|
|
+ //.Select(x => new
|
|
|
+ //{
|
|
|
+ // x.CreateTime,
|
|
|
+ // x.CheckNumber,
|
|
|
+ // x.ReservationsNo,
|
|
|
+ // x.DetermineNo,
|
|
|
+ // x.HotelName,
|
|
|
+ // x.HotelAddress,
|
|
|
+ // x.HotelTel,
|
|
|
+ // x.HotelFax,
|
|
|
+ // x.CheckInDate,
|
|
|
+ // x.CheckOutDate,
|
|
|
+ // x.GuestName,
|
|
|
+ // x.RoomExplanation,
|
|
|
+ //})
|
|
|
+ .OrderBy(x => x.CreateTime)
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
+ //判断数据是否完整
|
|
|
+ if (hrDtas.Count < 1) return Ok(JsonView(StatusCodes.Status400BadRequest, "请先录入酒店预订信息!", ""));
|
|
|
+
|
|
|
+ string strFileName = "HotelStatement/";
|
|
|
+ var dele = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(it => it.IsDel == 0 && it.Id == _dto.DiId).FirstAsync();
|
|
|
+ if (dele != null)
|
|
|
+ strFileName += dele.TourCode;
|
|
|
+
|
|
|
+ var guestDatas = await _sqlSugar.Queryable<Crm_DeleClient>().Where(it => it.IsDel == 0).ToListAsync();
|
|
|
+ for (int i = 0; i < hrDtas.Count; i++)
|
|
|
+ {
|
|
|
+ string guestNames = string.Empty;
|
|
|
+ List<int> guestIds = new List<int>();
|
|
|
+ var item = hrDtas[i];
|
|
|
+ //处理客户姓名
|
|
|
+ if (item.GuestName.Contains(","))
|
|
|
+ {
|
|
|
+ string[] guestIdArr = item.GuestName.Split(',');
|
|
|
+ foreach (var guestIdStr in guestIdArr)
|
|
|
+ if (int.TryParse(guestIdStr, out int guestId))
|
|
|
+ guestIds.Add(guestId);
|
|
|
+ }
|
|
|
+ else guestNames += item.GuestName;
|
|
|
+
|
|
|
+ if (guestIds.Count > 0)
|
|
|
+ {
|
|
|
+ guestIds = guestIds.Distinct().ToList();
|
|
|
+
|
|
|
+ var guestDatas1 = guestDatas.Where(it => guestIds.Contains(it.Id)).ToList();
|
|
|
+ if (guestDatas1.Count > 0)
|
|
|
+ {
|
|
|
+ guestNames = "";
|
|
|
+ foreach (var guest in guestDatas1)
|
|
|
+ {
|
|
|
+ string guestName = "";
|
|
|
+ if (guest.Sex == 0) guestName += @"MR.";
|
|
|
+ else if (guest.Sex == 1) guestName += @"MS.";
|
|
|
+
|
|
|
+ if (guest.Pinyin == null) guestName += $"{string.Join("", guest.LastName.GetTotalPingYin()).ToUpper()}/{string.Join("", guest.FirstName.GetTotalPingYin()).ToUpper()}";
|
|
|
+ else guestName += @$"{guest.Pinyin.Replace(" ", "")}";
|
|
|
+
|
|
|
+ guestNames += @$"{guestName.Trim()}、";
|
|
|
+ }
|
|
|
+ if (guestNames.Length > 0)
|
|
|
+ {
|
|
|
+ guestNames = guestNames.Substring(0, guestNames.Length - 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(guestNames))
|
|
|
+ {
|
|
|
+ hrDtas[i].GuestName = guestNames;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ strFileName += "VOUCHER.docx";
|
|
|
+
|
|
|
+ var fileDir = AppSettingsHelper.Get("WordBasePath") + strFileName;
|
|
|
+ //doc.Save(fileDir);
|
|
|
+ string Url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/" + strFileName;
|
|
|
+ return Ok(JsonView(true, "操作成功!", Url));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 酒店预订
|
|
|
/// 生成 预定成本 Excel
|