|
@@ -30,6 +30,10 @@ using NPOI.HPSF;
|
|
|
using SqlSugar;
|
|
|
using System.Collections;
|
|
|
using Org.BouncyCastle.Ocsp;
|
|
|
+using System.Globalization;
|
|
|
+using static QRCoder.PayloadGenerator;
|
|
|
+using Bookmark = Aspose.Words.Bookmark;
|
|
|
+using Aspose.Words.Fields;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
|
{
|
|
@@ -51,6 +55,7 @@ namespace OASystem.API.Controllers
|
|
|
private readonly DelegationVisaRepository _delegationVisaRep;
|
|
|
private readonly VisaPriceRepository _visaPriceRep;
|
|
|
private readonly CarTouristGuideGroundRepository _carTouristGuideGroundRep;
|
|
|
+ private readonly HotelPriceRepository _hotelPriceRep;
|
|
|
private readonly MessageRepository _message;
|
|
|
private readonly SqlSugarClient _sqlSugar;
|
|
|
#region 成本相关
|
|
@@ -67,8 +72,8 @@ namespace OASystem.API.Controllers
|
|
|
public GroupsController(IMapper mapper, SqlSugarClient sqlSugar, GrpScheduleRepository grpScheduleRep, DelegationInfoRepository groupRepository,
|
|
|
TaskAssignmentRepository taskAssignmentRep, AirTicketResRepository airTicketResRep, DecreasePaymentsRepository decreasePaymentsRep,
|
|
|
InvitationOfficialActivitiesRepository InvitationOfficialActivitiesRep, DelegationEnDataRepository delegationEnDataRep, EnterExitCostRepository enterExitCostRep
|
|
|
- , DelegationVisaRepository delegationVisaRep, MessageRepository message,VisaPriceRepository visaPriceRep,CarTouristGuideGroundRepository carTouristGuideGroundRep,CheckBoxsRepository checkBoxs, GroupCostRepository GroupCostRepository, CostTypeHotelNumberRepository CostTypeHotelNumberRepository,
|
|
|
- GroupCostParameterRepository GroupCostParameterRepository)
|
|
|
+ , DelegationVisaRepository delegationVisaRep, MessageRepository message, VisaPriceRepository visaPriceRep, CarTouristGuideGroundRepository carTouristGuideGroundRep, CheckBoxsRepository checkBoxs, GroupCostRepository GroupCostRepository, CostTypeHotelNumberRepository CostTypeHotelNumberRepository,
|
|
|
+ GroupCostParameterRepository GroupCostParameterRepository, HotelPriceRepository hotelPriceRep)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
|
_grpScheduleRep = grpScheduleRep;
|
|
@@ -88,15 +93,16 @@ namespace OASystem.API.Controllers
|
|
|
_enterExitCostRep = enterExitCostRep;
|
|
|
_delegationVisaRep = delegationVisaRep;
|
|
|
_message = message;
|
|
|
- _visaPriceRep= visaPriceRep;
|
|
|
- _carTouristGuideGroundRep= carTouristGuideGroundRep;
|
|
|
+ _visaPriceRep = visaPriceRep;
|
|
|
+ _carTouristGuideGroundRep = carTouristGuideGroundRep;
|
|
|
_checkBoxs = checkBoxs;
|
|
|
_GroupCostRepository = GroupCostRepository;
|
|
|
_CostTypeHotelNumberRepository = CostTypeHotelNumberRepository;
|
|
|
_GroupCostParameterRepository = GroupCostParameterRepository;
|
|
|
+ _hotelPriceRep = hotelPriceRep;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
#region 流程管控
|
|
|
|
|
|
/// <summary>
|
|
@@ -259,13 +265,50 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
if (dto == null) return Ok(JsonView(false, "请输入搜索搜索条件!"));
|
|
|
|
|
|
- var groupData = await _groupRepository.PostGroupPageList(dto);
|
|
|
- if (groupData.Code != 0)
|
|
|
+ if (dto.PortType == 1 || dto.PortType == 2) // web/Android
|
|
|
{
|
|
|
- return Ok(JsonView(false, groupData.Msg));
|
|
|
- }
|
|
|
+ string sqlWhere = string.Empty;
|
|
|
+ if (dto.IsSure == 0) //未完成
|
|
|
+ {
|
|
|
+ sqlWhere += string.Format(@" And IsSure = 0");
|
|
|
+ }
|
|
|
+ else if (dto.IsSure == 1) //已完成
|
|
|
+ {
|
|
|
+ sqlWhere += string.Format(@" And IsSure = 1");
|
|
|
+ }
|
|
|
|
|
|
- return Ok(JsonView(groupData.Data));
|
|
|
+ if (!string.IsNullOrEmpty(dto.SearchCriteria))
|
|
|
+ {
|
|
|
+ string tj = dto.SearchCriteria;
|
|
|
+ sqlWhere += string.Format(@"And (ssd.Name Like '%{0}%' Or TeamName Like '%{1}%' Or ClientName Like '%{2}%' Or ClientName Like '%{3}%' Or su.CnName Like '%{4}%')",
|
|
|
+ tj, tj, tj, tj, tj);
|
|
|
+ }
|
|
|
+
|
|
|
+ string sql = string.Format(@"Select Row_Number,SalesQuoteNo,TourCode,TeamTypeId, TeamType,
|
|
|
+ TeamLevId,TeamLev,TeamName,ClientName,ClientUnit,
|
|
|
+ VisitDate,VisitDays,VisitPNumber,JietuanOperator,IsSure,CreateTime
|
|
|
+ From (
|
|
|
+ Select row_number() over(order by gdi.CreateTime Desc) as Row_Number,
|
|
|
+ gdi.Id,SalesQuoteNo,TourCode,ssd.Id TeamTypeId, ssd.Name TeamType,
|
|
|
+ ssd1.Id TeamLevId,ssd1.Name TeamLev,TeamName,ClientName,ClientUnit,
|
|
|
+ VisitDate,VisitDays,VisitPNumber,su.CnName JietuanOperator,IsSure,gdi.CreateTime
|
|
|
+ From Grp_DelegationInfo gdi
|
|
|
+ Inner Join Sys_SetData ssd On gdi.TeamDid = ssd.Id
|
|
|
+ Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
|
|
|
+ Left Join Sys_Users su On gdi.JietuanOperator = su.Id
|
|
|
+ Where gdi.IsDel = 0 {0}
|
|
|
+ ) temp ", sqlWhere);
|
|
|
+
|
|
|
+ RefAsync<int> total = 0;//REF和OUT不支持异步,想要真的异步这是最优解
|
|
|
+ var _DelegationList = await _sqlSugar.SqlQueryable<DelegationListView>(sql).ToPageListAsync(dto.PageIndex, dto.PageSize, total);//ToPageAsync
|
|
|
+
|
|
|
+ return Ok(JsonView(true, "查询成功!", _DelegationList, total));
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "查询失败"));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -296,7 +339,6 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GroupEditBasicSource(GroupListDto dto)
|
|
|
{
|
|
|
-
|
|
|
var groupData = await _groupRepository.GroupEditBasicSource(dto);
|
|
|
if (groupData.Code != 0)
|
|
|
{
|
|
@@ -401,10 +443,10 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
GroupStepForDelegation.CreateWorkStep(dto.GroupId); //创建管控流程
|
|
|
|
|
|
- return Ok(JsonView(true,"操作成功!",groupData.Data));
|
|
|
+ return Ok(JsonView(true, "操作成功!", groupData.Data));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取团组名称data And 签证国别Data
|
|
@@ -659,10 +701,11 @@ namespace OASystem.API.Controllers
|
|
|
.SetColumns(it => it.WorkStatus == dto.visaStatus)
|
|
|
.Where(s => s.Id == dto.visaProgressCustomerId)
|
|
|
.ExecuteCommandAsync();
|
|
|
- if (updCount > 0 && dto.publishCode == 1) {
|
|
|
+ if (updCount > 0 && dto.publishCode == 1)
|
|
|
+ {
|
|
|
|
|
|
_delegationVisaRep.ChangeDataBase(DBEnum.OA2014DB); //切换到新OA后删除
|
|
|
-
|
|
|
+
|
|
|
string sqlDelegation = string.Format(@" Select * From DelegationInfo With(Nolock) Where Id = {0} ", dto.diId);
|
|
|
OA2021_DelegationInfo groupData = _sqlSugar.SqlQueryable<OA2021_DelegationInfo>(sqlDelegation).First();
|
|
|
//GroupInfoDto grpDto = new GroupInfoDto() { Id = dto.diId };
|
|
@@ -688,7 +731,8 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- if (rst) {
|
|
|
+ if (rst)
|
|
|
+ {
|
|
|
return Ok(JsonView(true, "发送通知成功"));
|
|
|
}
|
|
|
}
|
|
@@ -2752,14 +2796,14 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GetNationalTravelFeePageDataSource()
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
string sql = string.Format(@"Select * From Grp_NationalTravelFee Where Isdel = 0 ");
|
|
|
|
|
|
var nationalTravelFeeData = await _groupRepository._sqlSugar.SqlQueryable<Grp_NationalTravelFee>(sql).ToListAsync();
|
|
|
|
|
|
List<string> countryData = new List<string>();
|
|
|
|
|
|
- countryData.AddRange( nationalTravelFeeData.Select(it => it.Country ).ToList());
|
|
|
+ countryData.AddRange(nationalTravelFeeData.Select(it => it.Country).ToList());
|
|
|
countryData = countryData.Distinct().ToList();
|
|
|
|
|
|
List<dynamic> dataSource = new List<dynamic>();
|
|
@@ -2772,7 +2816,7 @@ namespace OASystem.API.Controllers
|
|
|
CountryName = item,
|
|
|
CityData = cityData1
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
dataSource.Add(countryData2);
|
|
|
}
|
|
|
|
|
@@ -2788,9 +2832,9 @@ namespace OASystem.API.Controllers
|
|
|
public async Task<IActionResult> PostNationalTravelFeePage(NationalTravelFeePageDto dto)
|
|
|
{
|
|
|
int portId = dto.PortType;
|
|
|
- if (portId != 1 && portId != 2 && portId != 3) return Ok(JsonView(false, "请输入正确的端口号!\r\n请求端口分类1 Web 2 Android 3 IOS"));
|
|
|
+ if (portId != 1 && portId != 2 && portId != 3) return Ok(JsonView(false, "请输入正确的端口号!\r\n请求端口分类1 Web 2 Android 3 IOS"));
|
|
|
|
|
|
- if (dto.PageIndex == 0) return Ok(JsonView(false, "当前页码数不能为0!"));
|
|
|
+ if (dto.PageIndex == 0) return Ok(JsonView(false, "当前页码数不能为0!"));
|
|
|
if (dto.PageSize == 0) return Ok(JsonView(false, "每页条数不能0!"));
|
|
|
|
|
|
string whereSql = string.Empty;
|
|
@@ -2844,7 +2888,7 @@ namespace OASystem.API.Controllers
|
|
|
whereSql = string.Format(@"And City = '{0}' ", dto.City);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
string sql = string.Format(@"Select gntf.Country,gntf.City,gntf.Currency,ssd.Name as CurrencyCode,
|
|
|
ssd.Remark as CurrencyName,gntf.RoomCost,gntf.FoodCost,gntf.PublicCost,
|
|
|
gntf.LastUpdateUserId,su.CnName as LastUpdateUserName,gntf.LastUpdateTime
|
|
@@ -2896,7 +2940,8 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- Grp_NationalTravelFee _nationalTravelFee = new Grp_NationalTravelFee() {
|
|
|
+ Grp_NationalTravelFee _nationalTravelFee = new Grp_NationalTravelFee()
|
|
|
+ {
|
|
|
Id = dto.Id,
|
|
|
DeleteUserId = dto.DeleteUserId,
|
|
|
DeleteTime = DateTime.Now.ToString("yyyy-MM-dd"),
|
|
@@ -3034,7 +3079,7 @@ namespace OASystem.API.Controllers
|
|
|
PassengerType = _PassengerType,
|
|
|
BankCard = _BankCard
|
|
|
};
|
|
|
- return Ok(JsonView(true, "查询成功!",data));
|
|
|
+ return Ok(JsonView(true, "查询成功!", data));
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -3103,8 +3148,8 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- Grp_CarTouristGuideGroundReservations _groupData = await _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().FirstAsync(a=>a.Id==dto.Id && a.IsDel==0);
|
|
|
- Grp_CreditCardPayment _creditCardPayment = await _sqlSugar.Queryable<Grp_CreditCardPayment>().FirstAsync(a => a.CId == dto.Id && a.CTable==79 && a.IsDel == 0);
|
|
|
+ Grp_CarTouristGuideGroundReservations _groupData = await _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().FirstAsync(a => a.Id == dto.Id && a.IsDel == 0);
|
|
|
+ Grp_CreditCardPayment _creditCardPayment = await _sqlSugar.Queryable<Grp_CreditCardPayment>().FirstAsync(a => a.CId == dto.Id && a.CTable == 79 && a.IsDel == 0);
|
|
|
var data = new
|
|
|
{
|
|
|
CarTouristGuideGround = _groupData,
|
|
@@ -3185,11 +3230,11 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> CarTouristGuideGroundContenInitialize(CarTouristGuideGroundContenDto dto)
|
|
|
+ public async Task<IActionResult> CarTouristGuideGroundContentInitialize(CarTouristGuideGroundContentDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- Result groupData = await _carTouristGuideGroundRep.CarTouristGuideGroundConten(dto);
|
|
|
+ Result groupData = await _carTouristGuideGroundRep.CarTouristGuideGroundContent(dto);
|
|
|
if (groupData.Code != 0)
|
|
|
{
|
|
|
return Ok(JsonView(false, groupData.Msg));
|
|
@@ -3208,11 +3253,11 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> OpCarTouristGuideGroundContenById(CarTouristGuideGroundIdDto dto)
|
|
|
+ public async Task<IActionResult> OpCarTouristGuideGroundContentById(CarTouristGuideGroundIdDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- Result groupData = await _carTouristGuideGroundRep.OpCarTouristGuideGroundContenById(dto);
|
|
|
+ Result groupData = await _carTouristGuideGroundRep.OpCarTouristGuideGroundContentById(dto);
|
|
|
if (groupData.Code != 0)
|
|
|
{
|
|
|
return Ok(JsonView(false, groupData.Msg));
|
|
@@ -3231,11 +3276,11 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> OpCarTouristGuideGroundConten(OpCarTouristGuideGroundContenDto dto)
|
|
|
+ public async Task<IActionResult> OpCarTouristGuideGroundContent(OpCarTouristGuideGroundContentDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- Result groupData = await _carTouristGuideGroundRep.OpCarTouristGuideGroundConten(dto);
|
|
|
+ Result groupData = await _carTouristGuideGroundRep.OpCarTouristGuideGroundContent(dto);
|
|
|
if (groupData.Code != 0)
|
|
|
{
|
|
|
return Ok(JsonView(false, groupData.Msg));
|
|
@@ -3265,9 +3310,9 @@ namespace OASystem.API.Controllers
|
|
|
ELSE 'False' END as isTrue from Grp_GroupCost where Isdel = 0 and date != '' group by Diid) b on a.Id = b.Diid
|
|
|
Where TeamName != '' And IsDel = 0 Order By a.Id Desc
|
|
|
").ToList(); //团组列表
|
|
|
- int diid = dto.Diid == - 1 ? groupList.First().Id : dto.Diid;
|
|
|
- var groupInfo = await _groupRepository.PostShareGroupInfo(new ShareGroupInfoDto { PortType = 1 , Id = diid }); //团组信息
|
|
|
- var groupChecks = _checkBoxs.GetCheckBoxsByDiid(diid); //团组选中信息 可枚举
|
|
|
+ int diid = dto.Diid == -1 ? groupList.First().Id : dto.Diid;
|
|
|
+ var groupInfo = await _groupRepository.PostShareGroupInfo(new ShareGroupInfoDto { PortType = 1, Id = diid }); //团组信息
|
|
|
+ var groupChecks = _checkBoxs.GetCheckBoxsByDiid(diid); //团组选中信息 可枚举
|
|
|
var groupCost = _GroupCostRepository.GetAllByDiid(diid); //团组列表信息
|
|
|
var groupCostMap = _mapper.Map<List<Grp_GroupCostDto>>(groupCost);
|
|
|
var hotelNumber = _CostTypeHotelNumberRepository.GetCostTypeHotelNumberByDiid(diid); //酒店数量 可枚举
|
|
@@ -3277,7 +3322,8 @@ namespace OASystem.API.Controllers
|
|
|
// Grp_GroupCostParameter());
|
|
|
var GroupCostParameterMap = _mapper.Map<List<Grp_GroupCostParameterDto>>(GroupCostParameter);
|
|
|
|
|
|
- return Ok(JsonView(new {
|
|
|
+ return Ok(JsonView(new
|
|
|
+ {
|
|
|
groupList,
|
|
|
groupInfo,
|
|
|
groupChecks,
|
|
@@ -3298,7 +3344,7 @@ namespace OASystem.API.Controllers
|
|
|
JsonView jw = null;
|
|
|
bool isTrue = false;
|
|
|
var Grp_groups = _mapper.Map<List<Grp_GroupCost>>(dto.GroupCosts);
|
|
|
- Grp_groups.ForEach(x => { x.CreateUserId = dto.Userid; x.CreateTime = DateTime.Now;}); //.ToString("yyyy-MM-dd HH:mm:ss")
|
|
|
+ Grp_groups.ForEach(x => { x.CreateUserId = dto.Userid; x.CreateTime = DateTime.Now; }); //.ToString("yyyy-MM-dd HH:mm:ss")
|
|
|
var Grp_CheckBoxs = _mapper.Map<List<Grp_CheckBoxs>>(dto.CheckBoxs);
|
|
|
Grp_CheckBoxs.ForEach(x => { x.CreateUserId = dto.Userid; x.CreateTime = DateTime.Now; });
|
|
|
var Grp_HotelNumber = _mapper.Map<List<Grp_CostTypeHotelNumber>>(dto.CostTypeHotelNumbers);
|
|
@@ -3314,7 +3360,7 @@ namespace OASystem.API.Controllers
|
|
|
isTrue = await _GroupCostParameterRepository.SaveAsync(Grp_CostParameters , dto.Userid ,dto.Diid); //系数
|
|
|
|
|
|
_sqlSugar.CommitTran();
|
|
|
- jw = JsonView(true,"保存成功!",isTrue);
|
|
|
+ jw = JsonView(true, "保存成功!", isTrue);
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
@@ -3389,8 +3435,663 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ #region 酒店预定
|
|
|
+ /// <summary>
|
|
|
+ /// 酒店预订页面初始化绑定
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> HotelReservationsInitialize(HotelReservationsDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ Result groupData = await _hotelPriceRep.HotelReservationsInitialize(dto);
|
|
|
+ if (groupData.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, groupData.Msg));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(true, groupData.Msg, groupData.Data));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, ex.Message));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 根基团组Id查询酒店费用列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> HotelReservationsByDiId(HotelReservationsByDiIdDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ Result groupData = await _hotelPriceRep.HotelReservationsByDiId(dto);
|
|
|
+ if (groupData.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, groupData.Msg));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(true, groupData.Msg, groupData.Data));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, ex.Message));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 根基酒店费用Id查询酒店费用详细
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> HotelReservationsById(HotelReservationsByIdDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ Result groupData = await _hotelPriceRep.HotelReservationsById(dto);
|
|
|
+ if (groupData.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, groupData.Msg));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(true, groupData.Msg, groupData.Data));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, ex.Message));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 计算酒店付款总金额
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> HotelConversionAmounts(HotelReservationsCNYDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ Result groupData = await _hotelPriceRep.HotelConversionAmounts(dto);
|
|
|
+ if (groupData.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, groupData.Msg));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(true, groupData.Msg, groupData.Data));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, ex.Message));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 根据酒店费用操作(Status:1.新增,2.修改)
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> OpHotelReservations(OpHotelReservationsData dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ Result groupData = await _hotelPriceRep.OpHotelReservations(dto);
|
|
|
+ if (groupData.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, groupData.Msg));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(true, groupData.Msg, groupData.Data));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, ex.Message));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 文件上传
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="file"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> UploadHotel(IFormFile file)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (file != null)
|
|
|
+ {
|
|
|
+ var fileDir = AppSettingsHelper.Get("GrpFileBasePath");
|
|
|
+ //文件名称
|
|
|
+ string projectFileName = file.FileName;
|
|
|
+
|
|
|
+ //上传的文件的路径
|
|
|
+ string filePath = "";
|
|
|
+
|
|
|
+
|
|
|
+ if (!Directory.Exists(fileDir))
|
|
|
+ {
|
|
|
+ Directory.CreateDirectory(fileDir);
|
|
|
+ }
|
|
|
+
|
|
|
+ //上传的文件的路径
|
|
|
+ filePath = fileDir + $@"\酒店费用录入相关文件\{projectFileName}";
|
|
|
+
|
|
|
+
|
|
|
+ using (FileStream fs = System.IO.File.Create(filePath))
|
|
|
+ {
|
|
|
+ file.CopyTo(fs);
|
|
|
+ fs.Flush();
|
|
|
+ }
|
|
|
+ return Ok(JsonView(true, "上传成功!", projectFileName));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "上传失败!"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 删除指定文件
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> DelFileHotel(DelFileDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string filePath = "";
|
|
|
+ var fileDir = AppSettingsHelper.Get("GrpFileBasePath");
|
|
|
+ // 返回与指定虚拟路径相对应的物理路径即绝对路径
|
|
|
+ //int id = 0;
|
|
|
+ filePath = fileDir + "/酒店费用录入相关文件/" + dto.fileName;
|
|
|
+ // 删除该文件
|
|
|
+ System.IO.File.Delete(filePath);
|
|
|
+ var result = await _sqlSugar.Updateable<Grp_HotelReservations>().Where(a => a.Id == dto.Id && a.IsDel==0).SetColumns(a => new Grp_HotelReservations()
|
|
|
+ {
|
|
|
+ Attachment = "",
|
|
|
+ }).ExecuteCommandAsync();
|
|
|
+ if (result != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(true, "成功!"));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "失败!"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 生成VOUCHER
|
|
|
+ /// </summary>
|
|
|
+ /// <param name=""></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> HotelGenerate(HotelReservationsByIdDto dto)
|
|
|
+ {
|
|
|
+
|
|
|
+ Grp_HotelReservations h = _sqlSugar.Queryable<Grp_HotelReservations>().First(a => a.Id == dto.Id && a.IsDel == 0);
|
|
|
+
|
|
|
+ //判断数据是否完整
|
|
|
+ if (h != null)
|
|
|
+ {
|
|
|
+ if (!string.IsNullOrEmpty(h.DetermineNo))
|
|
|
+ {
|
|
|
+ string strFileName = "HotelStatement/";
|
|
|
+ Grp_DelegationInfo dele= _sqlSugar.Queryable<Grp_DelegationInfo>().First(a => a.Id == h.DiId && a.IsDel == 0);
|
|
|
+ if (dele != null)
|
|
|
+ strFileName += dele.TourCode;
|
|
|
+
|
|
|
+
|
|
|
+ //载入模板
|
|
|
+ string sss = AppSettingsHelper.Get("WordBasePath") + "Template/酒店预订模板.doc";
|
|
|
+
|
|
|
+ Document doc = new Document(sss);
|
|
|
+ DocumentBuilder builder = new DocumentBuilder(doc);
|
|
|
+ try
|
|
|
+ {
|
|
|
+ #region 替换Word模板书签内容
|
|
|
+
|
|
|
+ //这里可以创建个DataTable循环添加书签的值,这里提示一下就不多做修改了
|
|
|
+ //入住卷预定号码
|
|
|
+
|
|
|
+ if (doc.Range.Bookmarks["VNO"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["VNO"];
|
|
|
+ mark.Text = h.CheckNumber;
|
|
|
+ }
|
|
|
+ //酒店时间
|
|
|
+ if (doc.Range.Bookmarks["Date"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["Date"];
|
|
|
+ mark.Text = Convert.ToDateTime(h.CreateTime).ToString("yyyy-MM-dd");
|
|
|
+ }
|
|
|
+ //团号
|
|
|
+ if (doc.Range.Bookmarks["TNo"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["TNo"];
|
|
|
+ mark.Text = dele.TourCode;
|
|
|
+ }
|
|
|
+ //预定号码
|
|
|
+ if (doc.Range.Bookmarks["BookingId"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["BookingId"];
|
|
|
+ mark.Text = h.ReservationsNo;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (doc.Range.Bookmarks["HotelConfirmNo"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["HotelConfirmNo"];
|
|
|
+ mark.Text = h.DetermineNo;
|
|
|
+ }
|
|
|
+
|
|
|
+ //酒店城市
|
|
|
+ if (doc.Range.Bookmarks["City"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["City"];
|
|
|
+ mark.Text = h.City;
|
|
|
+ }
|
|
|
+ //酒店名称
|
|
|
+ if (doc.Range.Bookmarks["HName"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["HName"];
|
|
|
+ mark.Text = h.HotelName;
|
|
|
+ }
|
|
|
+ //酒店地址
|
|
|
+ if (doc.Range.Bookmarks["Address"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["Address"];
|
|
|
+ mark.Text = h.HotelAddress;
|
|
|
+ }
|
|
|
+ //酒店电话
|
|
|
+ if (doc.Range.Bookmarks["Tel"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["Tel"];
|
|
|
+ mark.Text = h.HotelTel;
|
|
|
+ }
|
|
|
+ //酒店传真
|
|
|
+ if (doc.Range.Bookmarks["Fax"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["Fax"];
|
|
|
+ if (!string.IsNullOrWhiteSpace(h.HotelFax))
|
|
|
+ {
|
|
|
+ mark.Text = h.HotelFax;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //入住时间
|
|
|
+ if (doc.Range.Bookmarks["CIn"] != null)
|
|
|
+ {
|
|
|
+ DateTime dtCheckIn = Convert.ToDateTime(h.CheckInDate);
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["CIn"];
|
|
|
+ mark.Text = dtCheckIn.Day + " " + dtCheckIn.ToString("MMMM", CultureInfo.GetCultureInfo("en-US")) + " " + dtCheckIn.Year;
|
|
|
+ }
|
|
|
+ //退房时间
|
|
|
+ if (doc.Range.Bookmarks["COut"] != null)
|
|
|
+ {
|
|
|
+ DateTime dtCheckOut = Convert.ToDateTime(h.CheckOutDate);
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["COut"];
|
|
|
+ mark.Text = dtCheckOut.Day + " " + dtCheckOut.ToString("MMMM", CultureInfo.GetCultureInfo("en-US")) + " " + dtCheckOut.Year;
|
|
|
+ }
|
|
|
+ //客户名称
|
|
|
+ if (doc.Range.Bookmarks["GName"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["GName"];
|
|
|
+ mark.Text = h.GuestName;
|
|
|
+ }
|
|
|
+
|
|
|
+ //房间介绍
|
|
|
+ if (doc.Range.Bookmarks["ROOM"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["ROOM"];
|
|
|
+ mark.Text = h.RoomExplanation;
|
|
|
+ }
|
|
|
+
|
|
|
+ //报价描述
|
|
|
+ if (doc.Range.Bookmarks["NOTE"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["NOTE"];
|
|
|
+ Sys_SetData ss = _sqlSugar.Queryable<Sys_SetData>().First(a=>a.Id==h.ReservationsWebsite);
|
|
|
+ if (ss != null)
|
|
|
+ mark.Text = ss.Name;
|
|
|
+ }
|
|
|
+ //入住时间
|
|
|
+ if (doc.Range.Bookmarks["CheckIn"] != null)
|
|
|
+ {
|
|
|
+ DateTime dtCheckIn = Convert.ToDateTime(h.CheckInDate);
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["CheckIn"];
|
|
|
+ mark.Text = dtCheckIn.Day + " " + dtCheckIn.ToString("MMMM", CultureInfo.GetCultureInfo("en-US")) + " " + dtCheckIn.Year + " ";
|
|
|
+ }
|
|
|
+ //退房时间
|
|
|
+ if (doc.Range.Bookmarks["CheckOut"] != null)
|
|
|
+ {
|
|
|
+ DateTime dtCheckOut = Convert.ToDateTime(h.CheckOutDate);
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["CheckOut"];
|
|
|
+ mark.Text = " " + dtCheckOut.Day + " " + dtCheckOut.ToString("MMMM", CultureInfo.GetCultureInfo("en-US")) + " " + dtCheckOut.Year;
|
|
|
+ }
|
|
|
+ //日期
|
|
|
+ if (doc.Range.Bookmarks["DT"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["DT"];
|
|
|
+ mark.Text = Convert.ToDateTime(h.CreateTime).ToString("yyyy-MM-dd");
|
|
|
+ }
|
|
|
+ //名称
|
|
|
+ if (doc.Range.Bookmarks["VName"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["VName"];
|
|
|
+ mark.Text = h.HotelName;
|
|
|
+ }
|
|
|
+ //号码
|
|
|
+ if (doc.Range.Bookmarks["VOUCHERNO"] != null)
|
|
|
+ {
|
|
|
+ Bookmark mark = doc.Range.Bookmarks["VOUCHERNO"];
|
|
|
+ mark.Text = h.CheckNumber;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ //string fileName = "HotelStatement/" + diName + "机票费用报表" + "_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx";
|
|
|
+
|
|
|
+ strFileName += "VOUCHER.doc";
|
|
|
+
|
|
|
+ var fileDir = AppSettingsHelper.Get("WordBasePath")+ strFileName;
|
|
|
+ doc.Save(fileDir);
|
|
|
+ string Url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/" + strFileName;
|
|
|
+ return Ok(JsonView(true, "成功!", Url));
|
|
|
+
|
|
|
+ //保存为doc,并打开
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "酒店确定号码未填写,无法生成Voucher!"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "酒店确定号码未填写,无法生成Voucher!"));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 导出确认单
|
|
|
+ /// </summary>
|
|
|
+ /// <param name=""></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> ConfirmWord(HotelReservationsByIdDto dto)
|
|
|
+ {
|
|
|
+ //团组信息
|
|
|
+
|
|
|
+ Grp_DelegationInfo di = _sqlSugar.Queryable<Grp_DelegationInfo>().First(a => a.Id == dto.Id);
|
|
|
+
|
|
|
+ //酒店数据
|
|
|
+ List<Grp_HotelReservations> listhoteldata = _sqlSugar.Queryable<Grp_HotelReservations>().Where(a => a.DiId == dto.Id && a.IsDel == 0).ToList();
|
|
|
+
|
|
|
+ //利datatable存储
|
|
|
+ DataTable dt = new DataTable();
|
|
|
+ dt.Columns.Add("CheckInDate", typeof(string));
|
|
|
+ dt.Columns.Add("City", typeof(string));
|
|
|
+ dt.Columns.Add("Hotel", typeof(string));
|
|
|
+ dt.Columns.Add("Room", typeof(string));
|
|
|
+
|
|
|
+ for (int i = 0; i < listhoteldata.Count; i++)
|
|
|
+ {
|
|
|
+ DateTime dayStart = Convert.ToDateTime(listhoteldata[i].CheckInDate);
|
|
|
+ DateTime dayEnd = Convert.ToDateTime(listhoteldata[i].CheckOutDate);
|
|
|
+ while (dayStart < dayEnd)
|
|
|
+ {
|
|
|
+ string temp = "";
|
|
|
+ DataRow row = dt.NewRow();
|
|
|
+ row["CheckInDate"] = dayStart.ToString("yyyy-MM-dd");
|
|
|
+ row["City"] = listhoteldata[i].City;
|
|
|
+ row["Hotel"] = listhoteldata[i].HotelName;
|
|
|
+ if (listhoteldata[i].SingleRoomCount > 0)
|
|
|
+ {
|
|
|
+ temp = listhoteldata[i].SingleRoomCount + "个单间" + "\r\n";
|
|
|
+ }
|
|
|
+ if (listhoteldata[i].DoubleRoomCount > 0)
|
|
|
+ {
|
|
|
+ temp = temp + listhoteldata[i].DoubleRoomCount + "个表间" + "\r\n";
|
|
|
+ }
|
|
|
+ if (listhoteldata[i].SuiteRoomCount > 0)
|
|
|
+ {
|
|
|
+ temp = temp + listhoteldata[i].SuiteRoomCount + "个套房" + "\r\n";
|
|
|
+ }
|
|
|
+ if (listhoteldata[i].OtherRoomCount > 0)
|
|
|
+ {
|
|
|
+ temp = temp + listhoteldata[i].OtherRoomCount + "个其他房型" + "\r\n";
|
|
|
+ }
|
|
|
+ row["Room"] = temp;
|
|
|
+ dt.Rows.Add(row);
|
|
|
+ dayStart = dayStart.AddDays(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
|
+ dic.Add("Dele", di.TeamName);
|
|
|
+ dic.Add("City", di.VisitCountry);
|
|
|
+
|
|
|
+
|
|
|
+ //模板路径
|
|
|
+ //string sss = AppSettingsHelper.Get("WordBasePath") + "Template/酒店预订模板.doc";
|
|
|
+ string tempPath = AppSettingsHelper.Get("WordBasePath") + "Template/酒店用房确认单-模板.doc";
|
|
|
+ //载入模板
|
|
|
+ Aspose.Words.Document doc = new Aspose.Words.Document(tempPath);
|
|
|
+ DocumentBuilder builder = new DocumentBuilder(doc);
|
|
|
+
|
|
|
+ foreach (var key in dic.Keys)
|
|
|
+ {
|
|
|
+ builder.MoveToBookmark(key);
|
|
|
+ builder.Write(dic[key]);
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取word里所有表格
|
|
|
+ NodeCollection allTables = doc.GetChildNodes(NodeType.Table, true);
|
|
|
+ //获取所填表格的序数
|
|
|
+ Aspose.Words.Tables.Table tableOne = allTables[0] as Aspose.Words.Tables.Table;
|
|
|
+ var rowStart = tableOne.Rows[0]; //获取第1行
|
|
|
+ try
|
|
|
+ {
|
|
|
+ //循环赋值
|
|
|
+ for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ builder.MoveToCell(0, i + 1, 0, 0);
|
|
|
+ builder.Write(dt.Rows[i]["CheckInDate"].ToString());
|
|
|
+
|
|
|
+ builder.MoveToCell(0, i + 1, 1, 0);
|
|
|
+ builder.Write(dt.Rows[i]["City"].ToString());
|
|
|
+
|
|
|
+ builder.MoveToCell(0, i + 1, 2, 0);
|
|
|
+ builder.Write(dt.Rows[i]["Hotel"].ToString());
|
|
|
+
|
|
|
+ builder.MoveToCell(0, i + 1, 3, 0);
|
|
|
+ builder.Write(dt.Rows[i]["Room"].ToString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch
|
|
|
+ {
|
|
|
+ }
|
|
|
+ //删除多余行
|
|
|
+
|
|
|
+ while (tableOne.Rows.Count > dt.Rows.Count + 1)
|
|
|
+ {
|
|
|
+ tableOne.Rows.RemoveAt(dt.Rows.Count + 1);
|
|
|
+ }
|
|
|
+ string strFileName = di.TeamName + "酒店确认单.doc";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ doc.Save(AppSettingsHelper.Get("WordBasePath") + "HotelStatement/" + strFileName);
|
|
|
+ string Url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/HotelStatement/" + strFileName;
|
|
|
+ return Ok(JsonView(true, "成功", Url));
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "当前文档已打开,请先关闭!"));
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+
|
|
|
+ //doc.Save(HttpUtility.UrlEncode(strFileName, Encoding.UTF8), Aspose.Words.SaveFormat.Doc, Aspose.Words.SaveType.OpenInWord, Response);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 酒店费用删除
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> DelHotelPrice(DelBaseDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var res = await _hotelPriceRep.SoftDeleteByIdAsync<Grp_HotelReservations>(dto.Id.ToString(), dto.DeleteUserId);
|
|
|
+ if (!res)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "删除失败"));
|
|
|
+ }
|
|
|
+ var resultC = await _sqlSugar.Updateable<Grp_CreditCardPayment>().Where(a => a.CId == dto.Id && a.IsDel == 0 && a.CTable == 76).SetColumns(a => new Grp_CreditCardPayment()
|
|
|
+ {
|
|
|
+ IsDel = 1,
|
|
|
+ DeleteUserId = dto.DeleteUserId,
|
|
|
+ DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
|
|
+ }).ExecuteCommandAsync();
|
|
|
+ return Ok(JsonView(true, "删除成功!"));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 团组状态
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 团组状态列表 Page
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto">团组列表请求dto</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostGroupStatusPageList(GroupStatusListDto dto)
|
|
|
+ {
|
|
|
+ if (dto == null) return Ok(JsonView(false, "请输入搜索条件!"));
|
|
|
|
|
|
+ if (dto.PortType == 1 || dto.PortType == 2) // web/Android
|
|
|
+ {
|
|
|
+ string sqlWhere = string.Empty;
|
|
|
+ if (dto.IsSure == 0) //未完成
|
|
|
+ {
|
|
|
+ sqlWhere += string.Format(@" And IsSure = 0");
|
|
|
+ }
|
|
|
+ else if (dto.IsSure == 1) //已完成
|
|
|
+ {
|
|
|
+ sqlWhere += string.Format(@" And IsSure = 1");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(dto.SearchCriteria))
|
|
|
+ {
|
|
|
+ string tj = dto.SearchCriteria;
|
|
|
+ sqlWhere += string.Format(@"And (ssd.Name Like '%{0}%' Or TeamName Like '%{1}%' Or ClientName Like '%{2}%' Or ClientName Like '%{3}%' Or su.CnName Like '%{4}%')",
|
|
|
+ tj, tj, tj, tj, tj);
|
|
|
+ }
|
|
|
+
|
|
|
+ string sql = string.Format(@"Select Row_Number,Id,SalesQuoteNo,TourCode,TeamTypeId, TeamType,
|
|
|
+ TeamLevId,TeamLev,TeamName,ClientName,ClientUnit,
|
|
|
+ VisitDate,VisitDays,VisitPNumber,JietuanOperator,IsSure,CreateTime
|
|
|
+ From (
|
|
|
+ Select row_number() over(order by gdi.CreateTime Desc) as Row_Number,
|
|
|
+ gdi.Id,SalesQuoteNo,TourCode,ssd.Id TeamTypeId, ssd.Name TeamType,
|
|
|
+ ssd1.Id TeamLevId,ssd1.Name TeamLev,TeamName,ClientName,ClientUnit,
|
|
|
+ VisitDate,VisitDays,VisitPNumber,su.CnName JietuanOperator,IsSure,gdi.CreateTime
|
|
|
+ From Grp_DelegationInfo gdi
|
|
|
+ Inner Join Sys_SetData ssd On gdi.TeamDid = ssd.Id
|
|
|
+ Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
|
|
|
+ Left Join Sys_Users su On gdi.JietuanOperator = su.Id
|
|
|
+ Where gdi.IsDel = 0 {0}
|
|
|
+ ) temp ", sqlWhere);
|
|
|
+
|
|
|
+ RefAsync<int> total = 0;//REF和OUT不支持异步,想要真的异步这是最优解
|
|
|
+ var _DelegationList = await _sqlSugar.SqlQueryable<GroupStatusView>(sql).ToPageListAsync(dto.PageIndex, dto.PageSize, total);//ToPageAsync
|
|
|
|
|
|
+ return Ok(JsonView(true, "查询成功!", _DelegationList, total));
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "查询失败"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组状态
|
|
|
+ /// 设置操作完成
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto">团组列表请求dto</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostGroupStatusSetOperationComplete(GroupStatusSetOperationCompleteDto dto)
|
|
|
+ {
|
|
|
+ if (dto == null) return Ok(JsonView(false, "请输入搜索条件!"));
|
|
|
+
|
|
|
+
|
|
|
+ Grp_DelegationInfo _DelegationInfo = new Grp_DelegationInfo()
|
|
|
+ {
|
|
|
+ Id = dto.Id,
|
|
|
+ IsSure = 1
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ var result = await _sqlSugar.Updateable(_DelegationInfo)
|
|
|
+ .UpdateColumns(it => new { it.IsSure })
|
|
|
+ .WhereColumns(it => new { it.Id })
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+
|
|
|
+ if (result > 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(true, "操作完成!"));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(false, "操作失败!"));
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|