|
@@ -1,8 +1,12 @@
|
|
-using OASystem.API.OAMethodLib;
|
|
|
|
|
|
+using NPOI.HPSF;
|
|
|
|
+using OASystem.API.OAMethodLib;
|
|
using OASystem.Domain.Dtos.Resource;
|
|
using OASystem.Domain.Dtos.Resource;
|
|
using OASystem.Domain.Entities.Groups;
|
|
using OASystem.Domain.Entities.Groups;
|
|
using OASystem.Infrastructure.Repositories.Groups;
|
|
using OASystem.Infrastructure.Repositories.Groups;
|
|
|
|
+using Org.BouncyCastle.Utilities;
|
|
|
|
+using Quartz.Util;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
|
+using System.Net.Http.Headers;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
namespace OASystem.API.Controllers
|
|
{
|
|
{
|
|
@@ -26,13 +30,14 @@ namespace OASystem.API.Controllers
|
|
private readonly AirTicketAgentRepository _airTicketAgentRep;
|
|
private readonly AirTicketAgentRepository _airTicketAgentRep;
|
|
private readonly InvitationOfficialActivityDataRepository _InvitationOfficialActivityDataRep;
|
|
private readonly InvitationOfficialActivityDataRepository _InvitationOfficialActivityDataRep;
|
|
private readonly OfficialActivitiesRepository _officialActivitiesRep;
|
|
private readonly OfficialActivitiesRepository _officialActivitiesRep;
|
|
|
|
+ private readonly AskDataRepository _askDataRep;
|
|
private readonly SqlSugarClient _sqlSugar;
|
|
private readonly SqlSugarClient _sqlSugar;
|
|
|
|
|
|
public ResourceController(IMapper mapper, IConfiguration config, SqlSugarClient sqlSugar, CarDataRepository carDataRep,
|
|
public ResourceController(IMapper mapper, IConfiguration config, SqlSugarClient sqlSugar, CarDataRepository carDataRep,
|
|
LocalGuideDataRepository localGuideDataRep, ThreeCodeRepository threeCodeRep,
|
|
LocalGuideDataRepository localGuideDataRep, ThreeCodeRepository threeCodeRep,
|
|
HotelDataRepository hotelDataRep, ResItemInfoRepository resItemInfoRep, SetDataRepository setDataRepository,
|
|
HotelDataRepository hotelDataRep, ResItemInfoRepository resItemInfoRep, SetDataRepository setDataRepository,
|
|
CountryFeeRepository countryFeeRep, SetDataTypeRepository setDataTypeRep, AirTicketAgentRepository airTicketAgentRep,
|
|
CountryFeeRepository countryFeeRep, SetDataTypeRepository setDataTypeRep, AirTicketAgentRepository airTicketAgentRep,
|
|
- InvitationOfficialActivityDataRepository invitationOfficialActivityDataRep, OfficialActivitiesRepository officialActivitiesRep)
|
|
|
|
|
|
+ InvitationOfficialActivityDataRepository invitationOfficialActivityDataRep, OfficialActivitiesRepository officialActivitiesRep, AskDataRepository askDataRep)
|
|
{
|
|
{
|
|
_mapper = mapper;
|
|
_mapper = mapper;
|
|
_config = config;
|
|
_config = config;
|
|
@@ -48,6 +53,7 @@ namespace OASystem.API.Controllers
|
|
_airTicketAgentRep = airTicketAgentRep;
|
|
_airTicketAgentRep = airTicketAgentRep;
|
|
_InvitationOfficialActivityDataRep = invitationOfficialActivityDataRep;
|
|
_InvitationOfficialActivityDataRep = invitationOfficialActivityDataRep;
|
|
_officialActivitiesRep = officialActivitiesRep;
|
|
_officialActivitiesRep = officialActivitiesRep;
|
|
|
|
+ _askDataRep = askDataRep;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1538,7 +1544,11 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
throw;
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 上传文件
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="file"></param>
|
|
|
|
+ /// <returns></returns>
|
|
[HttpPost]
|
|
[HttpPost]
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
public async Task<IActionResult> UploadOfficialActivities(IFormFile file)
|
|
public async Task<IActionResult> UploadOfficialActivities(IFormFile file)
|
|
@@ -1591,7 +1601,11 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
throw;
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 删除文件
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
[HttpPost]
|
|
[HttpPost]
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
public async Task<IActionResult> DelloadOfficialActivities(DelBaseDto dto)
|
|
public async Task<IActionResult> DelloadOfficialActivities(DelBaseDto dto)
|
|
@@ -1621,9 +1635,194 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
throw;
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 删除公务出访信息
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost]
|
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
+ public async Task<IActionResult> DelOfficialActivities(DelBaseDto dto)
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ var res = await _officialActivitiesRep.SoftDeleteByIdAsync<Res_OfficialActivities>(dto.Id.ToString(), dto.DeleteUserId);
|
|
|
|
+ if (!res)
|
|
|
|
+ {
|
|
|
|
+ return Ok(JsonView(false, "删除失败"));
|
|
|
|
+ }
|
|
|
|
+ return Ok(JsonView(true, "删除成功!"));
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex)
|
|
|
|
+ {
|
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
|
+ throw;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ #region 请示数据库
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 查询请示数据库初始化
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost]
|
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
+ public async Task<IActionResult> QueryAskData(QueryAskDataDto dto)
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ Result groupData = await _askDataRep.QueryAskData(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, "程序错误!"));
|
|
|
|
+ throw;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 根据Id查询请示数据库单挑数据
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost]
|
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
+ public async Task<IActionResult> QueryAskDataById(QueryAskDataByIdDto dto)
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ Res_AskData _AskData = await _sqlSugar.Queryable<Res_AskData>().FirstAsync(a => a.IsDel == 0 && a.Id == dto.id);
|
|
|
|
+ if (_AskData==null)
|
|
|
|
+ {
|
|
|
|
+ return Ok(JsonView(true, "暂无数据!", _AskData));
|
|
|
|
+ }
|
|
|
|
+ return Ok(JsonView(true, "查询成功!", _AskData));
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex)
|
|
|
|
+ {
|
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
|
+ throw;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 请示数据库操作(Status:1.新增,2.修改)
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost]
|
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
+ public async Task<IActionResult> OpAskData(OpAskDataDto dto)
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ Result groupData = await _askDataRep.OpAskData(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, "程序错误!"));
|
|
|
|
+ throw;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 删除请示资料信息
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost]
|
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
+ public async Task<IActionResult> DelAskData(DelBaseDto dto)
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ var res = await _askDataRep.SoftDeleteByIdAsync<Res_AskData>(dto.Id.ToString(), dto.DeleteUserId);
|
|
|
|
+ if (!res)
|
|
|
|
+ {
|
|
|
|
+ return Ok(JsonView(false, "删除失败"));
|
|
|
|
+ }
|
|
|
|
+ return Ok(JsonView(true, "删除成功!"));
|
|
|
|
+ }
|
|
|
|
+ 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> AskAdviceDerive(AskAdviceDerive dto)
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ string Air = "";//机票信息
|
|
|
|
+ string Area = "";//城市
|
|
|
|
+ string Area2 = "";//城市
|
|
|
|
+ string ClientName = "";//人员
|
|
|
|
+ string ClientName2 = "";//人员
|
|
|
|
+ int ClientNumber =0;//总人数
|
|
|
|
+ string Content = "";//行程安排
|
|
|
|
+ string CountryAndDay = "";//各个国家待的天数
|
|
|
|
+ string Destination = "";//此行目的
|
|
|
|
+ string Destination2 = "";//此行目的
|
|
|
|
+ string Duration = "";//出访时间
|
|
|
|
+ int Durationdays = 0;//出访天数
|
|
|
|
+ int Durationdays2 =0;//出访天数
|
|
|
|
+ string Official = "";//对谁的邀请
|
|
|
|
+ string Temp = "";//出访任务
|
|
|
|
+ string VisitDate = "";//出访日期,多少号到多少号
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return Ok(JsonView(true, "导出成功!"));
|
|
|
|
+ }
|
|
|
|
+ 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> AskCityDerive(AskAdviceDerive dto)
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ return Ok(JsonView(true, "导出成功!"));
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex)
|
|
|
|
+ {
|
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
|
+ throw;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|